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

适用于