AuthorizationRuleCollection.IndexOf(AuthorizationRule) Metod

Definition

Hämtar samlingsindexet för det angivna AuthorizationRule objektet.

public:
 int IndexOf(System::Web::Configuration::AuthorizationRule ^ rule);
public int IndexOf(System.Web.Configuration.AuthorizationRule rule);
member this.IndexOf : System.Web.Configuration.AuthorizationRule -> int
Public Function IndexOf (rule As AuthorizationRule) As Integer

Parametrar

rule
AuthorizationRule

Objektet AuthorizationRule vars index returneras.

Returer

Indexet för det angivna AuthorizationRule objektet.

Exempel

I följande kodexempel visas hur metoden IndexOf används.

// Get the rule collection index.
System.Int32 ruleIndex = 
    authorizationSection.Rules.IndexOf(authorizationRule);
' Get the rule collection index.
  Dim ruleIndex As System.Int32 = _
  authorizationSection.Rules.IndexOf(authorizationRule)

Gäller för