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。
建構函式
| HttpModuleActionCollection() |
初始化 HttpModuleActionCollection 類別的新執行個體。 |
屬性
方法
明確介面實作
| ICollection.CopyTo(Array, Int32) |
將 ConfigurationElementCollection 複製至陣列。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別來篩選 IEnumerable 的項目。 |
| AsParallel(IEnumerable) |
啟用查詢的平行化作業。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |