HttpHandlersSection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定 Web 應用程式的 HTTP 處理常式。 此類別無法獲得繼承。
public ref class HttpHandlersSection sealed : System::Configuration::ConfigurationSection
public sealed class HttpHandlersSection : System.Configuration.ConfigurationSection
type HttpHandlersSection = class
inherit ConfigurationSection
Public NotInheritable Class HttpHandlersSection
Inherits ConfigurationSection
- 繼承
範例
下列程式代碼範例示範如何使用 HttpHandlersSection 類別來存取 httpHandlers 現有 Web 應用程式的 區段。
// Get the Web application configuration.
System.Configuration.Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
System.Web.Configuration.HttpHandlersSection httpHandlersSection = (System.Web.Configuration.HttpHandlersSection) configuration.GetSection("system.web/httphandlers");
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/aspnetTest")
' Get the section.
Dim httpHandlersSection As System.Web.Configuration.HttpHandlersSection = CType(configuration.GetSection("system.web/httphandlers"), System.Web.Configuration.HttpHandlersSection)
下列組態摘要說明如何以 httpHandlers 宣告方式指定 區段的值。
<httpHandlers>
<add path="Calculator.custom"
type="Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler"
verb="GET" validate="false" />
</httpHandlers>
備註
HttpHandlersSection 類別 (Class) 提供以程式的方法,存取和修改組態檔的 httpHandlers 區段。 此類型是包含 HttpHandlerAction 和型別之群組的 HttpHandlerActionCollection 一部分。
注意
HttpHandlersSection可以根據其值為 Everywhere的 section 屬性,AllowDefinition從 組態檔的相關區段讀取和寫入資訊。
建構函式
| HttpHandlersSection() |
初始化 HttpHandlersSection 類別的新執行個體。 |