HttpHandlerAction 类

表示 ASP.NET HTTP 处理程序。

语法

class HttpHandlerAction : CollectionElement  

方法

此类不包含任何方法。

属性

下表列出了 HttpHandlerAction 类公开的属性。

名称 描述
Path 一个只读 string 值,包含单个 URL 的路径或通配符字符串。 一个键属性。
Type 一个读/写 string 值,指定 HTTP 处理程序的托管类型。 ASP.NET 先在应用程序的专用 \Bin 目录中搜索处理程序程序集 DLL,然后在系统程序集缓存中搜索。 注意:类型引用的构成方式如下(括号中的项不是必需的):Namespace.Typename, Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z](例如“ExampleNamespace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%”)。
Validate 一个读/写 boolean 值。 如果 ASP.NET 等待加载处理程序类,直到匹配的请求到达,则为 true;否则为 false。 默认为 true
Verb 一个只读 string 值,指定以逗号分隔的 HTTP 谓词列表(例如,“GET, PUT, POST”)。 通配符 ("*") 表示所有谓词。 一个键属性。

子类

此类不包含子类。

注解

此类的实例包含在 HttpHandlersSection 类的 HttpHandlers 属性中。

HttpHandlerAction 类表示的 HTTP 处理程序特定于 ASP.NET,且位于 Web.config 文件的 <system.web> 部分。 这些处理程序包含在 HttpHandlersSection 类中。

HandlerAction 类表示的 HTTP 处理程序与 IIS 7 相关,并且位于 ApplicationHost.config 文件的 <system.webServer> 节中。 这些处理程序包含在 HandlersSection 类中。

示例

以下示例显示 HttpHandersSection 对象的 HttpHandlers 属性中包含的 HttpHandlerAction 实例。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the HttpHandlersSection.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
oSite.GetSection "HttpHandlersSection", oSection  
  
' Display the HttpHandlerAction instances contained in the  
' HttpHandlers property of HttpHandlersSection.  
For Each oHttpHandler In oSection.HttpHandlers  
     Counter = Counter + 1  
     WScript.Echo "[" & Counter & "] Path: " & oHttpHandler.Path  
     WScript.Echo "Type: " & oHttpHandler.Type  
     WScript.Echo "Validate: " & oHttpHandler.Validate  
     WScript.Echo "Verb: " & oHttpHandler.Verb  
     WScript.Echo  
Next  
  

继承层次结构

CollectionElement

HttpHandlerAction

要求

类型 描述
客户端 - IIS 7.0(在 Windows Vista 上)
- Windows 7 上的 IIS 7.5
- Windows 8 上的 IIS 8.0
- Windows 10 上的 IIS 10.0
服务器 - Windows Server 2008 上的 IIS 7.0
- Windows Server 2008 R2 上的 IIS 7.5
- Windows Server 2012 上的 IIS 8.0
- Windows Server 2012 R2 上的 IIS 8.5
- Windows Server 2016 上的 IIS 10.0
产品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 文件 WebAdministration.mof

另请参阅

CollectionElement 类
HandlerAction 类
HandlersSection 类
HttpHandlersSection 类