HttpHandlerActionCollection.Remove 方法

定义

从集合中删除对象 HttpHandlerAction

重载

名称 说明
Remove(HttpHandlerAction)

从集合中删除对象 HttpHandlerAction

Remove(String, String)

HttpHandlerAction从集合中删除具有指定Verb属性和Path属性的对象。

Remove(HttpHandlerAction)

从集合中删除对象 HttpHandlerAction

public:
 void Remove(System::Web::Configuration::HttpHandlerAction ^ action);
public void Remove(System.Web.Configuration.HttpHandlerAction action);
member this.Remove : System.Web.Configuration.HttpHandlerAction -> unit
Public Sub Remove (action As HttpHandlerAction)

参数

action
HttpHandlerAction

HttpHandlerAction 删除的对象。

例外

集合中不存在传递 HttpHandlerAction 的对象、已删除元素或集合是只读的。

示例

下面的代码示例演示如何从集合中删除对象 HttpHandlerAction


// Remove a HttpHandlerAction object 
    HttpHandlerAction httpHandler3 = new HttpHandlerAction(
     "Calculator.custom",
     "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler",
     "GET", true);
    httpHandlers.Remove(httpHandler3);

' Remove a HttpHandlerAction object 
    Dim httpHandler3 As System.Web.Configuration.HttpHandlerAction  = new HttpHandlerAction( _
    "Calculator.custom", _
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
    "GET", _
    true)
    httpHandlers.Remove(httpHandler3)

注解

此方法将元素插入 remove 到配置文件的相应节中,用于在较高级别的配置文件中定义的任何元素。 如果元素在当前配置文件的相应节中定义,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中。

适用于

Remove(String, String)

HttpHandlerAction从集合中删除具有指定Verb属性和Path属性的对象。

public:
 void Remove(System::String ^ verb, System::String ^ path);
public void Remove(string verb, string path);
member this.Remove : string * string -> unit
Public Sub Remove (verb As String, path As String)

参数

verb
String

Verb属于要删除的处理程序的属性值。

path
String

Path属于要删除的处理程序的属性值。

例外

集合中没有 HttpHandlerAction 具有指定键的对象,该元素已被删除,或集合为只读。

示例

下面的代码示例演示如何从集合中删除对象 HttpHandlerAction


// Remove the handler with the specified verb and path.
httpHandlers.Remove("GET", "*.custom");

'Remove the handler with the specified verb and path.
httpHandlers.Remove("GET", "*.custom")

注解

此方法将元素插入 remove 到配置文件的相应节中,用于在较高级别的配置文件中定义的任何元素。 如果元素在当前配置文件的相应节中定义,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中。

适用于