HttpModuleActionCollection.RemoveAt(Int32) 方法

定義

從集合中移除指定索引的模組 HttpModuleAction

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

參數

index
Int32

HttpModuleAction模組索引要移除。

例外狀況

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

範例

以下範例說明如何從集合中移除模組 HttpModuleAction


// Remove the module from the collection.
if (!httpModulesSection.SectionInformation.IsLocked)
{
    modulesCollection.RemoveAt(0);
    configuration.Save();
}
' Remove the module from the collection.
If Not httpModulesSection.SectionInformation.IsLocked Then
    modulesCollection.RemoveAt(0)
    configuration.Save()
End If

備註

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

適用於