HttpHandlersSection 类
配置 ASP.NET 处理程序的设置。
语法
class HttpHandlersSection : ConfigurationSectionWithCollection
方法
下表列出了 HttpHandlersSection
类公开的方法。
名称 | 说明 |
---|---|
添加 | (继承自 ConfigurationSectionWithCollection。) |
清除 | (从 ConfigurationSectionWithCollection 继承。) |
Get | (从 ConfigurationSectionWithCollection 继承。) |
GetAllowDefinition | (继承自 ConfigurationSection。) |
GetAllowLocation | (从 ConfigurationSection 继承。) |
删除 | (从 ConfigurationSectionWithCollection 继承。) |
RevertToParent | (从 ConfigurationSection 继承。) |
SetAllowDefinition | (从 ConfigurationSection 继承。) |
SetAllowLocation | (从 ConfigurationSection 继承。) |
属性
下表列出了 HttpHandlersSection
类公开的属性。
名称 | 描述 |
---|---|
HttpHandlers |
一个由 HttpHandlerAction 值构成的数组,包含 ASP.NET 处理程序。 |
Location |
(继承自 ConfigurationSection 。)一个键属性。 |
Path |
(继承自 ConfigurationSection 。)一个键属性。 |
SectionInformation |
(从 ConfigurationSection 继承。) |
子类
此类不包含子类。
注解
HttpHandlersSection
类中包含的 HTTP 处理程序特定于 ASP.NET,位于 Web.config 文件的 <system.web>
部分中。 每个处理程序都由 HttpHandlerAction
类的一个实例表示。
HandlersSection 类中的 HTTP 处理程序与 IIS 7 相关,位于 ApplicationHost.config 文件的 <system.webServer>
部分中。 每个处理程序都由 HandlerAction 类的一个实例表示。
示例
以下示例展示了 HttpHandlersSection
属性,包括 HttpHandlers
属性中的 HttpHandlerAction
值。
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the HttpHandlersSection.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "HttpHandlersSection", oSection
' Display the Path and Location properties.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo
' Display the HttpHandlerAction instances that are contained
' in the HttpHandlers property.
WScript.Echo "----------( Http Handlers )----------"
Counter = 0
For Each oHttpHandler In oSection.HttpHandlers
Counter = Counter + 1
WScript.Echo "[" & Counter & "] Path: " & oHttpHandler.Path
WScript.Echo "Type: " & oHttpHandler.Type
WScript.Echo "Validate: " & oHttpHandler.Validate
WScript.Echo "Verb: " & oHttpHandler.Verb
WScript.Echo
Next
继承层次结构
ConfigurationSectionWithCollection
HttpHandlersSection
要求
类型 | 描述 |
---|---|
客户端 | - IIS 7.0(在 Windows Vista 上) - IIS 7.5(在 Windows 7 上) - IIS 8.0(在 Windows 8 上) - IIS 10.0(在 Windows 10 上) |
服务器 | - IIS 7.0(在 Windows Server 2008 上) - IIS 7.5(在 Windows Server 2008 R2 上) - IIS 8.0(在 Windows Server 2012 上) - IIS 8.5(在 Windows Server 2012 R2 上) - IIS 10.0(在 Windows Server 2016 上) |
产品 | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 |
MOF 文件 | WebAdministration.mof |
另请参阅
ConfigurationSectionWithCollection 类
HandlerAction 类
HandlersSection 类
HttpHandlerAction 类