HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar samlingsindexet för det angivna HttpHandlerAction objektet.
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
Parametrar
- action
- HttpHandlerAction
Det HttpHandlerAction objekt som samlingsindexet ska hämtas för.
Returer
Samlingsindexvärdet.
Exempel
Följande kodexempel visar hur du hämtar ett HttpHandlerAction objektsamlingsindex.
// 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)
Kommentarer
Innan du använder den här metoden måste du identifiera ett HttpHandlerAction objekt med rätt namn och typ. Du kan sedan använda det här objektet för att hämta dess samlingsindex.