AuthorizationRuleCollection.Set(Int32, AuthorizationRule) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在指定索引處,將指定的 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)