SiteContainsConfigurationSection Class1

提供网站与其配置节之间的关系。

语法

class SiteContainsConfigurationSection : ObjectConfigurationAssociation  

方法

此类不包含任何方法。

属性

下表列出了 SiteContainsConfigurationSection 类的属性。

名称 描述
Container 一个表示 IIS 网站的只读 Site 对象。
Element 一个只读 ConfigurationSection 对象,该对象公开网站的配置节。

子类

此类没有子类。

注解

关联仅返回在对象级别定义的对象实例。 例如,如果 <authentication> 节是 Web.config 文件中在网站级别定义的唯一节,则仅返回 ConfigurationSection 对象的 AuthenticationSection 实例。

若要获取所有可用节,应使用 ConfiguredObject 类的 GetAllSections 方法。

示例

以下示例列出了在默认网站的 Web.config 级别定义的所有配置节。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the default Web site.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
  
' List the configuration sections present in the Web.config file  
' of the default Web site.  
Set oSections = oSite.Associators_("SiteContainsConfigurationSection")  
For Each oSection In oSections  
    WScript.Echo oSection.Path_.Class  
Next  

继承层次结构

ObjectConfigurationAssociation

SiteContainsConfigurationSection

要求

类型 描述
客户端 - 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

另请参阅

ConfiguredObject.GetAllSections 方法
ObjectConfigurationAssociation 类
Site 类
VirtualDirectoryContainsConfigurationSection 类