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 配置系统调用。 使用 Handlers 属性获取 类的HttpHandlerAction实例。

适用于

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 配置系统调用。 使用 Handlers 属性获取 类的HttpHandlerAction实例。

适用于