Freigeben über


AuthorizationRuleCollection.Set(Int32, AuthorizationRule) Methode

Definition

Fügt der Auflistung am angegebenen Index das angegebene AuthorizationRule-Objekt hinzu.

public:
 void Set(int index, System::Web::Configuration::AuthorizationRule ^ rule);
public void Set (int index, System.Web.Configuration.AuthorizationRule rule);
member this.Set : int * System.Web.Configuration.AuthorizationRule -> unit
Public Sub Set (index As Integer, rule As AuthorizationRule)

Parameter

index
Int32

Die Indexposition, an der das angegebene AuthorizationRuleCollection-Objekt hinzugefügt werden soll.

rule
AuthorizationRule

Das hinzuzufügende AuthorizationRule-Objekt.

Beispiele

Im folgenden Codebeispiel wird die Verwendung der Set-Methode veranschaulicht.

// Using the AuthorizationRuleCollection Set method.

// Define the rule to add to the collection.

// Define the collection index.
System.Int32 rIndex = 0;

// Set the rule in the collection.
authorizationRuleCollection.Set(rIndex, 
    authorizationRule);
' Using the AuthorizationRuleCollection Set method.
' Define the rule to add to the collection.
' Define the collection index.
Dim rIndex As System.Int32 = 0

' Set the rule in the collection.
  authorizationRuleCollection.Set(rIndex, _
  authorizationRule)

Gilt für