共用方式為


HttpHandlerActionCollection.IndexOf(HttpHandlerAction) 方法

定義

取得指定 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 物件。

傳回

Int32

集合索引值。

範例

下列程式碼範例示範如何取得 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 具有適當名稱和類型的物件。 然後,您可以使用這個物件來取得其集合索引。

適用於