AuthorizationRuleCollection.RemoveAt(Int32) 方法

定義

從指定索引的集合中移除一個 AuthorizationRule 物件。

public:
 void RemoveAt(int index);
public void RemoveAt(int index);
member this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

參數

index
Int32

要移除的索引位置 AuthorizationRule

例外狀況

集合中沒有 AuthorizationRule 具有指定索引的物件,元素已被移除,或集合是唯讀。

範例

下列程式代碼範例示範如何使用 RemoveAt 方法。 參考課堂主題中的 AuthorizationSection 程式碼範例,學習如何取得該集合。

// Using the AuthorizationRuleCollection RemoveAt method.
authorizationRuleCollection.RemoveAt(0);
' Using the AuthorizationRuleCollection RemoveAt method.
authorizationRuleCollection.RemoveAt(0)

備註

此方法將元素插入 remove 設定檔中對應高階設定檔中定義的元素的適當區段。 如果該元素在目前設定檔的適當區段中被定義,該元素的條目會從設定檔中移除。 要移除的物件必須存在於集合中。

適用於