AuthorizationRuleCollection.IndexOf(AuthorizationRule) 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 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)