HttpModulesSection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定 Web 應用程式的 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
- 繼承
範例
這個範例示範如何以宣告方式指定 區段中專案httpModules屬性add的值,也可以做為 類別的成員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 類別 (Class) 提供以程式的方法,存取和修改組態檔的 httpModules 區段。
此類型是包含 HttpModuleAction 和型別之群組的 HttpModuleActionCollection 一部分。
注意
HttpModulesSection可以根據其值為 Everywhere的 section 屬性AllowDefinition,從 組態檔的相關區段讀取和寫入資訊。
建構函式
| HttpModulesSection() |
初始化 HttpModulesSection 類別的新執行個體。 |