Compartilhar via


HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Método

Definição

Obtém o índice de coleção do objeto HttpHandlerAction especificado.

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

Parâmetros

action
HttpHandlerAction

O objeto HttpHandlerAction para o qual obter o índice de coleção.

Retornos

Int32

O valor do índice da coleção.

Exemplos

O exemplo de código a seguir mostra como obter um HttpHandlerAction índice de coleção de objetos.


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

Comentários

Antes de usar esse método, você deve identificar um HttpHandlerAction objeto com o nome e o tipo adequados. Em seguida, você pode usar esse objeto para obter seu índice de coleção.

Aplica-se a