HttpModuleAction 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
配置 HttpModulesSection 模組。 此類別無法獲得繼承。
public ref class HttpModuleAction sealed : System::Configuration::ConfigurationElement
public sealed class HttpModuleAction : System.Configuration.ConfigurationElement
type HttpModuleAction = class
inherit ConfigurationElement
Public NotInheritable Class HttpModuleAction
Inherits ConfigurationElement
- 繼承
範例
此範例示範如何宣告性地指定該區段元素add的多個屬性值,這些屬性httpModules也可作為類別成員HttpModuleAction存取。
以下設定檔範例說明如何以宣告方式 httpModules 指定該區段的值。
請參閱 「如何建立與設定 HTTP 模組 」以了解如何建置與設定 HTTP 模組。
<httpModules>
<add name="TimerModule"
type="Samples.Aspnet.Configuration.RequestTimeInterval, RequestTimeInterval Version=1.0.1557.23158, Culture=neutral,
PublicKeyToken=7bfb33146a87b52e, processorArchitecture=MSIL"/>
</httpModules>
以下程式碼範例說明如何使用這個 HttpModuleAction 類別。
// 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 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)
備註
這個 HttpModuleAction 類別提供了一種程式化的方式,可以存取並修改 add 設定檔中該 httpModules 區段的元素。
型 HttpModuleAction 別是包含 HttpModuleActionCollection、集合和 HttpModulesSection 型別的群組的一部分。
建構函式
| 名稱 | Description |
|---|---|
| HttpModuleAction(String, String) |
利用傳遞的參數初始化類別的新實例 HttpModuleAction 。 |