HttpModuleActionCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 HttpModuleAction 对象集合。 此类不能被继承。
public ref class HttpModuleActionCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.HttpModuleAction))]
public sealed class HttpModuleActionCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.HttpModuleAction))>]
type HttpModuleActionCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class HttpModuleActionCollection
Inherits ConfigurationElementCollection
- 继承
- 属性
示例
下面的示例演示如何使用 HttpModuleActionCollection 类。
// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration(
"/aspnetTest");
// Get the section.
HttpModulesSection httpModulesSection =
(HttpModulesSection)configuration.GetSection(
"system.web/httpModules");
// Get the collection.
HttpModuleActionCollection modulesCollection =
httpModulesSection.Modules;
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim httpModulesSection As HttpModulesSection = _
CType(configuration.GetSection( _
"system.web/httpModules"), HttpModulesSection)
' Get the collection.
Dim modulesCollection _
As HttpModuleActionCollection = httpModulesSection.Modules
以下示例是配置文件的摘录,使 ASP.NET 能够使用自定义模块。 有关如何生成和配置 HTTP 模块的完整示例,请参阅 如何:创建和配置 HTTP 模块。
<httpModules>
<add name="TimerModule"
type="Samples.AspNet.RequestTimeInterval, RequestTimeInterval Version=1.0.1557.23158, Culture=neutral,
PublicKeyToken=7bfb33146a87b52e, processorArchitecture=MSIL"/>
</httpModules>
注解
集合HttpModuleActionCollection允许访问 节的HttpModuleActionHttpModulesSection元素。
构造函数
| HttpModuleActionCollection() |
初始化 HttpModuleActionCollection 类的新实例。 |
属性
方法
显式接口实现
| ICollection.CopyTo(Array, Int32) |
将 ConfigurationElementCollection 复制到数组。 (继承自 ConfigurationElementCollection) |
扩展方法
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |