HttpModulesSection 类

包含 ASP.NET 模块。

语法

class HttpModulesSection : ConfigurationSectionWithCollection  

方法

下表列出了 HttpModulesSection 类公开的方法。

名称 说明
添加 (继承自 ConfigurationSectionWithCollection。)
清除 (从 ConfigurationSectionWithCollection 继承。)
Get (从 ConfigurationSectionWithCollection 继承。)
GetAllowDefinition (继承自 ConfigurationSection。)
GetAllowLocation (从 ConfigurationSection 继承。)
删除 (从 ConfigurationSectionWithCollection 继承。)
RevertToParent (从 ConfigurationSection 继承。)
SetAllowDefinition (从 ConfigurationSection 继承。)
SetAllowLocation (从 ConfigurationSection 继承。)

属性

下表列出了 HttpModulesSection 类公开的属性。

名称 描述
Location (继承自 ConfigurationSection。)一个键属性。
HttpModules HttpModuleAction 值的数组,其中包含 ASP.NET 模块。
Path (继承自 ConfigurationSection。)一个键属性。
SectionInformation (从 ConfigurationSection 继承。)

子类

此类不包含子类。

注解

HttpModulesSection 类中的模块是特定于 ASP.NET,且位于 Web.config 文件的 <system.web> 节中。 其中每个模块都由 HttpModuleAction 类的实例表示。

ModulesSection 类中的模块与 IIS 7 相关,并且位于 ApplicationHost.config 文件的 <system.webServer> 节中。 其中每个模块都由 ModuleAction 类的实例表示。

示例

以下示例展示了 HttpModulesSection 属性,包括 HttpModules 属性中的 HttpModuleAction 值。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the HttpModulesSection.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
oSite.GetSection "HttpModulesSection", oSection  
  
' Display the Path and Location properties.  
WScript.Echo "Path: " & oSection.Path  
WScript.Echo "Location: " & oSection.Location  
WScript.Echo  
  
' Display the HttpModuleAction instances that are contained  
' in the HttpModules property.  
WScript.Echo "----------( Http Modules )----------"  
Counter = 0  
For Each oHttpModule In oSection.HttpModules  
     Counter = Counter + 1  
     WScript.Echo "[" & Counter & "] Name: " & oHttpModule.Name  
     WScript.Echo "Type: " & oHttpModule.Type  
     WScript.Echo  
Next  
  

继承层次结构

ConfigurationSection

ConfigurationSectionWithCollection

HttpModulesSection

要求

类型 描述
客户端 - Windows Vista 上的 IIS 7.0
- Windows 7 上的 IIS 7.5
- Windows 8 上的 IIS 8.0
- Windows 10 上的 IIS 10.0
服务器 - Windows Server 2008 上的 IIS 7.0
- Windows Server 2008 R2 上的 IIS 7.5
- Windows Server 2012 上的 IIS 8.0
- Windows Server 2012 R2 上的 IIS 8.5
- Windows Server 2016 上的 IIS 10.0
产品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 文件 WebAdministration.mof

另请参阅

ConfigurationSectionWithCollection 类
HttpModuleAction 类
ModuleAction 类
ModulesSection 类