用作包含集合的配置节类的基类。
语法
class ConfigurationSectionWithCollection : ConfigurationSection
方法
下表列出了 ConfigurationSectionWithCollection 类公开的方法。
| 名称 | 说明 |
|---|---|
| 添加 | 将元素添加到配置节中的集合。 |
| 清除 | 从配置节中的集合中清除所有元素。 |
| Get | 从配置节中检索集合的指定成员。 |
| GetAllowDefinition | (继承自 ConfigurationSection。) |
| GetAllowLocation | (从 ConfigurationSection 继承。) |
| 删除 | 从配置节中的集合中删除指定元素。 |
| RevertToParent | (从 ConfigurationSection 继承。) |
| SetAllowDefinition | (从 ConfigurationSection 继承。) |
| SetAllowLocation | (从 ConfigurationSection 继承。) |
属性
下表列出了 ConfigurationSectionWithCollection 类公开的属性。
| 名称 | 描述 |
|---|---|
Location |
(继承自 ConfigurationSection。)一个键属性。 |
Path |
(继承自 ConfigurationSection。)一个键属性。 |
SectionInformation |
(从 ConfigurationSection 继承。) |
子类
下表列出了 ConfigurationSectionWithCollection 类公开的子类。
| 名称 | 描述 |
|---|---|
| ApplicationDependenciesSection | 公开应用程序依赖项信息。 |
| AppSettingsSection | 包含自定义应用程序设置,例如文件路径、XML Web 服务 URL,或者应用程序的 .ini 文件中存储的信息。 |
| AuthenticationModulesSection | 指定使用服务器执行身份验证过程的身份验证模块。 |
| AuthenticationSection | 配置 ASP.NET 身份验证。 |
| AuthorizationSection | 配置用于访问 URL 的授权。 |
| CachingSection | 配置输出和内核缓存。 |
| ClientTargetSection | 指定别名和用户代理之间的映射集合。 |
| CompilationSection | 配置 ASP.NET 应用程序的编译设置。 |
| ConfigProtectedDataSection | 包含受保护的配置提供程序信息。 |
| ConnectionManagementSection | 包含一个集合,该集合为 System.Net API 指定与指定网络主机的最大连接数。 |
| ConnectionStringsSection | 为 ASP.NET 应用程序指定数据库连接字符串集合。 |
| CustomErrorsSection | 配置 ASP.NET 自定义错误消息。 |
| DefaultDocumentSection | 指定默认情况下要用于客户端的网页文件名。 |
| DefaultProxySection | 配置 Web 代理服务器默认值。 |
| DeviceFiltersSection | 表示确定移动设备类型或移动浏览器功能的设备筛选器集合。 |
| FastCgiSection | 包含 FastCGI 应用程序的配置设置。 |
| GlobalModulesSection | 公开 IIS 全局模块的配置设置。 |
| HandlersSection | 存储 URL 的处理程序。 |
| HealthMonitoringSection | 配置用于运行状况监视的应用程序。 |
| HttpCompressionSection | 配置 HTTP 压缩。 |
| HttpErrorsSection | 配置 Web 服务器的 HTTP 错误处理。 |
| HttpHandlersSection | 配置 ASP.NET 处理程序的设置。 |
| HttpModulesSection | 包含 ASP.NET 模块。 |
| HttpProtocolSection | 表示 HTTP 协议配置节。 |
| HttpRedirectSection | 配置 HTTP 重定向。 |
| HttpTracingSection | 表示 HTTP 跟踪配置节。 |
| IisClientCertificateMappingAuthenticationSection | 配置 IIS 客户端证书的映射。 |
| IPSecuritySection | 根据 IP 地址相关信息配置对 Web 服务器内容的访问。 |
| IsapiCgiRestrictionSection | 为在 ISAPI 模式下运行的 Web 服务器配置 ISAPI 和通用网关接口 (CGI) 限制。 |
| IsapiFiltersSection | 在 Web 服务器上配置 ISAPI 筛选器。 |
| ListenerAdaptersSection | 公开侦听器适配器的集合。 |
| MembershipSection | 验证用户凭据和管理用户设置。 |
| MobileControlsSection | 公开移动控件、其适配器和设备筛选器的配置信息。 |
| ModulesSection | 表示配置文件中的模块节。 |
| OutputCacheSettingsSection | 指定可应用于 ASP.NET 应用程序中的页面的输出缓存配置文件设置。 |
| PagesSection | 表示 Web.config 文件的 <pages> 节。 |
| ProtocolsSection | 包含传输协议列表,ASP.NET 可使用这些协议解密 HTTP 请求中从客户端浏览器发送的数据。 |
| RequestFilteringSection | 配置传入 URL 请求的扫描。 |
| RoleManagerSection | 定义配置设置,这些设置用于支持 Web 应用程序的角色管理基础结构。 |
| SchemaImporterExtensionsSection | 包含将 XML 架构 (XSD) 类型映射到 .NET Framework 类型的扩展的集合。 |
| SecurityPolicySection | 定义安全策略文件与其信任级别名称之间的映射集合。 |
| SessionStateSection | 配置 Web 应用程序的会话状态。 |
| SiteMapSection | 定义站点导航的配置设置。 |
| SqlCacheDependencySection | 表示 System.Web.Caching.SqlCacheDependency |
| StaticContentSection | 公开网站上静态内容的配置设置。 |
| SystemCodeDomSection | 指定提供代码文档对象模型 (CodeDOM) 支持的编译器集合。 |
| SystemDataSection | 指定已安装的 ADO.NET 数据提供程序的列表。 |
| SystemDiagnosticsSection | 配置系统诊断和跟踪。 |
| TraceFailedRequestsSection | 表示失败请求跟踪配置节。 |
| TraceProviderDefinitionsSection | 表示定义跟踪提供程序的配置节。 |
| UrlMappingsSection | 表示包含入站/出站 URL 映射对的 <urlMappings> 节。 |
| WebRequestModulesSection | 包含已注册的 Web 请求模块的集合。 |
| WebServicesSection | 控制 XML Web 服务及其客户端的行为。 |
| WindowsAuthenticationSection | 使用集成 Windows 身份验证。 |
注解
如果更改集合中的键属性,则集合中属性的位置顺序(和索引)可能会更改。 更改后的键属性将添加到集合的开头或末尾,具体取决于 mergeAppend 特性的值。
注意
mergeAppend 特性位于相应架构文件中与类属性对应的节中。 如果 mergeAppend 特性为 false,则新项将添加到集合的开头;如果 mergeAppend 特性为 true,则新项将添加到集合的末尾。
在键属性的值更改后,应注意如何访问集合中的键属性。 例如,如果更改索引为 4 的键属性的值,则在 mergeAppend 特性为 false 的情况下,键属性的新索引将为 0。
注意
创建自定义架构和自定义配置文件时,应注意此行为。 不应修改 IIS 7 附带的架构文件中的 mergeAppend 特性。 无法使用 IIS 7 的 WMI 提供程序修改 mergeAppend 特性。
mergeAppend 特性会影响 IIS 7 附带的下列 ConfigurationSectionWithCollection 类属性。 该表列出了这些属性及其相应的架构文件。 在所有这些情况下,IIS 7 附带的架构文件为 mergeAppend 特性指定 false。
| 类 | properties | 架构文件 |
|---|---|---|
| AuthorizationSection | Authorization |
ASPNET_Schema.xml |
| CachingSection | Profiles.Profiles |
IIS_Schema.xml |
| DefaultDocumentSection | Files.Files |
IIS_Schema.xml |
| HandlersSection | Handlers |
IIS_Schema.xml |
| HttpHandlersSection | HttpHandlers |
ASPNET_Schema.xml |
继承层次结构
ConfigurationSectionWithCollection
要求
| 类型 | 描述 |
|---|---|
| 客户端 | - 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 |
另请参阅
AuthorizationRule 类
AuthorizationSection 类
CachingProfileElement 类
CachingProfileSettings 类
CachingSection 类
ConfigurationSection 类
DefaultDocumentSection 类
FileSettings 类
HandlerAction 类
HandlersSection 类
HttpHandlerAction 类
HttpHandlersSection 类
StringElement 类