HttpModulesSection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為網頁應用程式配置 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
- 繼承
範例
此範例示範如何宣告性地指定該區段中元素add屬性的值,該屬性httpModules也可作為類別成員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 區段。
此類型屬於包含 和 HttpModuleActionHttpModuleActionCollection 的群組。
Note
可以 HttpModulesSection 根據該區段屬性 AllowDefinition (值為 Everywhere)從設定檔的相關區段讀寫資訊。
建構函式
| 名稱 | Description |
|---|---|
| HttpModulesSection() |
初始化 HttpModulesSection 類別的新執行個體。 |