在ii7+与iis6上注册自定义HttpModule和HttpHandlers
HTTP handler To register an HTTP handler for IIS 6.0
<configuration>lt;system.web>
lt;httpHandlers>
lt;add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
lt;/httpHandlers>
lt;system.web>
lt;/configuration>
To register an HTTP handler for IIS 7.0 running in Classic mode
<configuration>lt;system.web>
lt;httpHandlers>
lt;add verb="*" path="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly" />
lt;/httpHandlers>
lt;system.web>
lt;system.webServer>
lt;add name=SampleHandler" verb="*" path="SampleHandler.new"
Modules="IsapiModule"
criptProcessor="FrameworkPath\aspnet_isapi.dll"
resourceType="File" />
lt;/system.webServer>
lt;/configuration>
To register an HTTP handler for IIS 7.0 running in Integrated Mode
<configuration>lt;system.webServer>
lt;handlers>
lt;add name="SampleHandler" verb="*"
ath="SampleHandler.new"
type="SampleHandler, SampleHandlerAssembly"
resourceType="Unspecified" />
lt;/handlers>
lt;system.webServer>
lt;/configuration>
HTTP Module To register the module for IIS 6.0 and IIS 7.0 running in Classic mode
<configuration>lt;system.web>
lt;httpModules>
lt;add name="HelloWorldModule" type="HelloWorldModule"/>
lt;/httpModules>
lt;/system.web>
lt;/configuration>
To register the module for IIS 7.0 running in Integrated mode
<configuration>lt;system.webServer>
lt;modules>
lt;add name="HelloWorldModule" type="HelloWorldModule"/>
lt;/modules>
lt;/system.webServer>
lt;/configuration>
http://msdn.microsoft.com/en-us/library/ms227673%28v=VS.100%29.aspx
http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx