ClientTargetCollection.RemoveAt(Int32) 方法

定義

移除具有指定集合索引的 ClientTarget 物件。

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

參數

index
Int32

收集索引 ClientTarget 將被移除。

範例

以下程式碼範例將物件從集合中移除。ClientTargetClientTargetCollection

關於如何取得集合的資訊,請參考課程總覽中的 ClientTargetCollection 程式碼範例。


// Remove the client target at the 
// specified index from the collection.
clientTargets.RemoveAt(0);

// Update the configuration file.
if (!clientTargetSection.IsReadOnly())
  configuration.Save();
' Remove the client target at the 
' specified index from the collection.
clientTargets.RemoveAt(0)

' Update the configuration file.
If Not clientTargetSection.IsReadOnly() Then
    configuration.Save()
End If

備註

RemoveAt方法會刪除該區段中add當前階層層級的元素clientTarget,並插入一個remove元素。 該 remove 元素實際上移除了階層 add 結構中父組態檔案中定義的元素參考,但不會刪除該元素。

適用於

另請參閱