語言

NamespaceCollection.RemoveAt(Int32) 方法

定義

移除 ProfileGroupSettings 集合中指定的索引中的物件。

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

參數

index
Int32

一個物件的索引 NamespaceInfo ,從集合中移除。

例外狀況

集合中指定的索引沒有 NamespaceInfo 物件。

-或-

該元素已經被移除。

-或-

本合集為唯讀。

範例

下列程式代碼範例示範如何使用 RemoveAt 方法。 此程式碼範例是本類別更大範例 PagesSection 的一部分。

// Execute the RemoveAt method.
pagesSection.Namespaces.RemoveAt(0);
' Execute the RemoveAt method.
pagesSection.Namespaces.RemoveAt(0)

備註

若指定元素定義於較高階的設定檔中,此方法會在當前應用程式層級的適當區段插入元素 remove 。 若該元素在目前設定檔中定義,則其條目將從設定檔中移除。 要移除的物件必須存在於集合中;若不成功,則擲出 A ConfigurationException 。

適用於

另請參閱