HttpModuleActionCollection.RemoveAt(Int32) Metod

Definition

Tar bort en HttpModuleAction modul vid det angivna indexet från samlingen.

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

Parametrar

index
Int32

Indexet för modulen som HttpModuleAction du vill ta bort.

Undantag

Det finns inget HttpModuleAction objekt i det angivna indexet i samlingen, elementet har redan tagits bort eller samlingen är skrivskyddad.

Exempel

I följande exempel visas hur du tar bort en HttpModuleAction modul från samlingen.


// 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

Kommentarer

Den här metoden infogar ett <remove> element i lämplig del av konfigurationsfilen för alla element som definierats i en konfigurationsfil på högre nivå. Om elementet definieras i lämpligt avsnitt i den aktuella konfigurationsfilen tas dess post bort från konfigurationsfilen. Det objekt som ska tas bort måste finnas i samlingen.

Gäller för