HttpModulesSection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为 Web 应用程序配置 HTTP 模块。 此类不能被继承。
public ref class HttpModulesSection sealed : System::Configuration::ConfigurationSection
public sealed class HttpModulesSection : System.Configuration.ConfigurationSection
type HttpModulesSection = class
inherit ConfigurationSection
Public NotInheritable Class HttpModulesSection
Inherits ConfigurationSection
- 继承
示例
此示例演示如何以声明方式为 节中的 httpModules
元素的属性add
指定值,这些属性也可以作为 类的成员HttpModulesSection进行访问。
以下配置文件示例演示如何以声明方式为 httpModules 元素 (ASP.NET“设置架构) ”部分指定值。
<httpModules>
<add name="TimerModule"
type="Samples.Aspnet.Configuration.RequestTimeInterval, RequestTimeInterval Version=1.0.1557.23158, Culture=neutral,
PublicKeyToken=7bfb33146a87b52e, processorArchitecture=MSIL"/>
</httpModules>
下面的代码示例演示如何使用 HttpModulesSection 类。
// Get the Web application configuration.
Configuration configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the HttpModulesSection.
HttpModulesSection httpModulesSection = (HttpModulesSection) configuration.GetSection("system.web/httpModules");
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
' Get the HttpModulesSection.
Dim httpModulesSection As HttpModulesSection = CType(configuration.GetSection("system.web/httpModules"), HttpModulesSection)
注解
HttpModulesSection 类提供一种以编程方式访问和修改配置文件的 httpModules
节的方法。
此类型是包含 HttpModuleAction 和 类型的组的 HttpModuleActionCollection 一部分。
注意
HttpModulesSection可以根据值为 Everywhere的 section 属性AllowDefinition,从配置文件的相关节读取和写入信息。
构造函数
HttpModulesSection() |
初始化 HttpModulesSection 类的新实例。 |