Język

HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Metoda

Definicja

Pobiera indeks kolekcji określonego HttpHandlerAction obiektu.

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

Parametry

action
HttpHandlerAction

Obiekt HttpHandlerAction , dla którego ma być pobierany indeks kolekcji.

Zwraca

Wartość indeksu kolekcji.

Przykłady

Poniższy przykład kodu przedstawia sposób uzyskiwania indeksu HttpHandlerAction kolekcji obiektów.


// 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)

Uwagi

Przed użyciem tej metody należy zidentyfikować HttpHandlerAction obiekt o odpowiedniej nazwie i typie. Następnie możesz użyć tego obiektu, aby uzyskać indeks kolekcji.

Dotyczy