語言

HttpHandlerActionCollection.Remove 方法

定義

從集合中移除一個 HttpHandlerAction 物件。

多載

名稱 Description
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 設定檔中對應高階設定檔中定義的元素的適當區段。 如果該元素在目前設定檔的適當區段中被定義,該元素的條目會從設定檔中移除。 要移除的物件必須存在於集合中。

適用於