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 收藏可存取 HttpModuleAction 該區段的各元素 HttpModulesSection 。
建構函式
| 名稱 | Description |
|---|---|
| HttpModuleActionCollection() |
初始化 HttpModuleActionCollection 類別的新執行個體。 |
屬性
方法
明確介面實作
| 名稱 | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
將 ConfigurationElementCollection 複製到陣列。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| 名稱 | Description |
|---|---|
| AsParallel(IEnumerable) |
啟用查詢的平行處理。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別篩選 IEnumerable 的專案。 |