Share via


HttpHandlerAction 建構函式

定義

初始化 HttpHandlerAction 類別的新執行個體。

多載

HttpHandlerAction(String, String, String)

使用傳遞的參數,初始化 HttpHandlerAction 類別的新執行個體。

HttpHandlerAction(String, String, String, Boolean)

使用傳遞的參數,初始化 HttpHandlerAction 類別的新執行個體。

HttpHandlerAction(String, String, String)

使用傳遞的參數,初始化 HttpHandlerAction 類別的新執行個體。

public:
 HttpHandlerAction(System::String ^ path, System::String ^ type, System::String ^ verb);
public HttpHandlerAction (string path, string type, string verb);
new System.Web.Configuration.HttpHandlerAction : string * string * string -> System.Web.Configuration.HttpHandlerAction
Public Sub New (path As String, type As String, verb As String)

參數

path
String

HttpHandlerAction URL 路徑。

type
String

逗號分隔類別/組件組合,由版本、文化特性和公開金鑰語彙基元組成。

verb
String

HTTP 動作的逗號分隔清單 (例如,"GET, PUT, POST")。

備註

HttpHandlerAction 構函式不適合直接從您的程式碼使用。 ASP.NET 組態系統會呼叫它。 您可以使用 屬性來取得 類別 HandlersHttpHandlerAction 實例。

適用於

HttpHandlerAction(String, String, String, Boolean)

使用傳遞的參數,初始化 HttpHandlerAction 類別的新執行個體。

public:
 HttpHandlerAction(System::String ^ path, System::String ^ type, System::String ^ verb, bool validate);
public HttpHandlerAction (string path, string type, string verb, bool validate);
new System.Web.Configuration.HttpHandlerAction : string * string * string * bool -> System.Web.Configuration.HttpHandlerAction
Public Sub New (path As String, type As String, verb As String, validate As Boolean)

參數

path
String

HttpHandlerAction URL 路徑。

type
String

逗號分隔類別/組件組合,由版本、文化特性和公開金鑰語彙基元組成。

verb
String

HTTP 動作的逗號分隔清單 (例如,"GET, PUT, POST")。

validate
Boolean

true 表示允許驗證,否則為 false。 如果為 false,則 ASP.NET 不會在找到實際相符的要求之前嘗試載入類別,這樣會潛在地延遲錯誤,但是會改善啟動時間。

範例

下列程式碼範例示範如何建立 HttpHandlerAction 物件。

// Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction(
    "Calculator.custom", 
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", 
    "GET", 
    true));
' Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction( _
    "Calculator.custom", _
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
    "GET", _
    true))

備註

HttpHandlerAction 構函式不適合直接從您的程式碼使用。 ASP.NET 組態系統會呼叫它。 您可以使用 屬性來取得 類別 HandlersHttpHandlerAction 實例。

適用於