我创建的IHttpModule实现
public class ResponseTweaker : IHttpModule { // my module ...
<system.web> <httpModules> <add name="redman" type="ResponseTweaker"/> </httpModules>
它的一个例子正在酝酿中。
怎样 我得到了那个模块实例的引用?
这些模块可以在 HttpContext.Current.ApplicationInstance.Modules .
HttpContext.Current.ApplicationInstance.Modules
你可以通过 HttpModuleCollection ,或使用名称语法: HttpContext.Current.ApplicationInstance.Modules["redman"] IHttpModule 键入 ResponseTweaker .
HttpModuleCollection
HttpContext.Current.ApplicationInstance.Modules["redman"]
IHttpModule
ResponseTweaker
如果类型可能不同,请搜索集合以查找与所需类型匹配的模块。