UrlMappingCollection.RemoveAt(Int32) 方法

定義

從集合中移除 UrlMapping 具有指定索引的物件。

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

參數

index
Int32

要移除物件的 UrlMapping 集合索引。

範例

以下程式碼範例將物件從 中移除。UrlMappingUrlMappingCollection

參考課堂主題中的 UrlMappingCollection 程式碼範例,學習如何取得該集合。


// Remove the URL at the 
// specified index from the collection.
urlMappings.RemoveAt(0);

// Update the configuration file.
if (!urlMappingSection.IsReadOnly())
  configuration.Save();
' Remove the URL at the 
' specified index from the collection.
urlMappings.RemoveAt(0)

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

備註

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

適用於

另請參閱