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 具有適當名稱和類型的物件。 然後,您可以使用這個物件來取得其集合索引。