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> 元素插入配置文件的相应部分,以用于更高级别配置文件中定义的任何元素。 如果在当前配置文件的相应部分中定义了 元素,则会从配置文件中删除其条目。 要删除的对象必须存在于集合中。

适用于