共用方式為


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

備註

方法 RemoveAtadd 刪除目前階層層級區 urlMappings 段中的專案,並插入 remove 專案。 remove 元素實際上會移除階層中較高層級上父組態檔中定義的元素參考 add ,但不會刪除它。

適用於

另請參閱