Share via


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> 元素插入組態檔的適當區段中,以取得較高層級組態檔中定義的任何專案。 如果專案是在目前組態檔的適當區段中定義,則會從組態檔中移除其專案。 要移除的物件必須存在於集合中。

適用於