充当表示配置节的类的基类。
语法
class ConfigurationSection
方法
下表列出了 ConfigurationSection 类公开的方法。
| 名称 | 描述 |
|---|---|
| GetAllowDefinition | 检索配置节的 allowDefinition 属性。 |
| GetAllowLocation | 检索配置节的 allowLocation 属性。 |
| RevertToParent | 将节中的配置值还原为其父级的配置值。 |
| SetAllowDefinition | 为配置节设置 allowDefinition 属性。 |
| SetAllowLocation | 为配置节设置 allowLocation 属性。 |
属性
下表列出了 ConfigurationSection 类公开的属性。
| 名称 | 描述 |
|---|---|
Location |
一个只读 string 值,包含目标对象相对于当前对象的路径。 例如,在对象路径“MACHINE/WEBROOT/APPHOST/MYSITE/APP/”中,Location 属性将包含“MYSITE/APP/”。 一个键属性。 |
Path |
一个只读 string 值,包含当前对象的路径。 例如,在对象路径“MACHINE/WEBROOT/APPHOST/MYSITE/APP/”中,Path 属性将包含“MACHINE/WEBROOT/APPHOST/”。 一个键属性。 |
SectionInformation |
一个 SectionInformation 对象,其读/写属性提供元数据并控制配置节的锁定。 |
子类
下表列出了 ConfigurationSection 类公开的子类。
| 名称 | 描述 |
|---|---|
| AccessSection | 指定对受安全套接字层 (SSL) 保护的内容的访问权限。 |
| AnonymousAuthenticationSection | 配置匿名身份验证。 |
| AnonymousIdentificationSection | 指定如何在 Web 应用程序中使用 Cookie。 |
| AspSection | 公开 ASP 应用程序的 Active Server Pages (ASP) 配置设置。 |
| BasicAuthenticationSection | 配置基本身份验证。 |
| CacheSection | 定义 ASP.NET Web 应用程序的缓存设置。 |
| CgiSection | 配置通用网关接口 (CGI) 设置。 |
| ClientCertificateMappingAuthenticationSection | 启用或禁用客户端证书映射身份验证。 |
| ConfigurationHistorySection | 配置 ApplicationHost 帮助程序服务的配置历史记录设置。 |
| ConfigurationRedirectionSection | 配置 ApplicationHost.config 和 Administration.config 文件的位置。 |
| ConfigurationSectionWithCollection | 用作包含集合的配置节类的基类。 |
| DateTimeSerializationSection | 处理 System.DateTime 实例的 XML 序列化的配置设置。 |
| DigestAuthenticationSection | 配置摘要式身份验证。 |
| DirectoryBrowseSection | 在 IIS 中配置目录浏览。 |
| GlobalizationSection | 配置 Web 应用程序的全球化设置。 |
| HostingEnvironmentSection | 定义控制应用程序托管环境行为的配置设置。 |
| HttpCookiesSection | 配置 Web 应用程序使用的 cookie 的属性。 |
| HttpLoggingSection | 配置 HTTP 请求的日志记录。 |
| HttpRuntimeSection | 配置 ASP.NET HTTP 运行时设置,以确定如何处理给定 ASP.NET 应用程序的请求。 |
| IdentitySection | 指定 ASP.NET 应用程序是否应作为应用程序池标识(默认)、经过 IIS 身份验证的用户标识或自定义配置的标识运行。 |
| LogSection | 配置服务器或站点的日志记录。 |
| MachineKeySection | 定义控制密钥生成和算法的配置设置,这些密钥生成和算法在 Forms 身份验证、视图状态验证和会话状态应用程序隔离中用于加密、解密和媒体访问控制 (MAC) 操作。 |
| OdbcLoggingSection | 指定通过开放式数据库连接 (ODBC) 连接将 IIS 事件记录到数据库的配置设置。 |
| OutputCacheSection | 指定 ASP.NET 应用程序的输出缓存设置。 |
| ProcessModelSection | 在运行 IIS 的 Web 服务器上配置 ASP.NET 进程模型设置。 |
| RequestCachingSection | 包含请求缓存的配置信息。 |
| ServerRuntimeSection | 配置适用于 Web 服务器上应用程序的请求限制。 |
| ServerSideIncludeSection | 配置服务器端包含 (SSI) 指令。 |
| SessionPageStateSection | 配置 ASP.NET 应用程序的页面视图状态设置。 |
| SettingsSection | 包含指定 .NET Framework 如何连接到网络的设置。 |
| SmtpMailSettingsSection | 包含简单邮件传输协议 (SMTP) 配置设置。 |
| SystemWebDeploymentSection | 定义支持 Web 应用程序部署的配置设置。 |
| SystemWindowsFormsSection | 存储 Windows 窗体应用程序的应用程序设置。 |
| TraceSection | 配置 ASP.NET 代码跟踪服务。 |
| TransactionsDefaultSettingsSection | 包含事务的默认设置。 |
| TransactionsMachineSettingsSection | 表示配置文件中的 XML 部分,其中包含只能在计算机级别修改的设置。 |
| TrustSection | 配置应用于应用程序的代码访问安全性的级别。 |
| UrlCompressionSection | 启用或禁用动态或静态压缩。 |
| ValidationSection | 启用或禁用对配置文件的验证检查。 |
| WebControlsSection | 指定客户端脚本文件的共享位置。 |
| WebLimitsSection | 指定对发往 Web 服务器的客户端流量的限制。 |
| XhtmlConformanceSection | 指定 ASP.NET 应用程序的 XHTML 呈现模式。 |
| XmlSerializerSection | 处理用于配置 XML 序列化的 XML 元素。 |
注解
派生自 ObjectConfigurationAssociation 类的关联类使用 ConfigurationSection 类将对象链接到配置部分。
派生自 ConfigurationSection 的所有类都继承 Location、Path 和 SectionInformation 属性。 Location 和 Path 是 ConfigurationSection 的所有子类的键属性。
要求
| 类型 | 描述 |
|---|---|
| 客户端 | - 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 |
另请参阅
WMI 提供程序
ConfigurationSectionWithCollection 类
ObjectConfigurationAssociation 类
SectionInformation 类