AuthorizationRuleCollection.Set(Int32, AuthorizationRule) 方法

定义

将指定的 AuthorizationRule 对象添加到集合中的指定索引处。

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)

参数

index
Int32

将指定的 AuthorizationRuleCollection 对象添加到的索引位置。

rule
AuthorizationRule

要添加的 AuthorizationRule 对象。

示例

下面的代码示例说明如何使用 Set 方法。

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

适用于