HttpHandlerActionCollection.IndexOf(HttpHandlerAction) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得指定 HttpHandlerAction 物件的集合索引。
public:
int IndexOf(System::Web::Configuration::HttpHandlerAction ^ action);
public int IndexOf(System.Web.Configuration.HttpHandlerAction action);
member this.IndexOf : System.Web.Configuration.HttpHandlerAction -> int
Public Function IndexOf (action As HttpHandlerAction) As Integer
參數
- action
- HttpHandlerAction
HttpHandlerAction取得收藏索引的物件。
傳回
收藏指數值。
範例
以下程式碼範例說明如何取得 HttpHandlerAction 物件集合索引。
// Get the specified handler's index.
HttpHandlerAction httpHandler2 = new HttpHandlerAction(
"Calculator.custom",
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler",
"GET", true);
int handlerIndex = httpHandlers.IndexOf(httpHandler2);
'Get the specified handler's index.
Dim httpHandler2 As System.Web.Configuration.HttpHandlerAction = new HttpHandlerAction( _
"Calculator.custom", _
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
"GET", _
true)
Dim handlerIndex As Integer = httpHandlers.IndexOf(httpHandler2)
備註
使用此方法前,您必須先以正確名稱和類型識別 HttpHandlerAction 物件。 接著你可以用這個物件取得它的集合索引。