Auf Englisch lesen

Freigeben über


HttpModulesSection.Modules Eigenschaft

Definition

C#
[System.Configuration.ConfigurationProperty("", IsDefaultCollection=true)]
public System.Web.Configuration.HttpModuleActionCollection Modules { get; }

Eigenschaftswert

Eine HttpModuleActionCollection der HttpModuleAction-Objekte oder -Module, die im HttpModulesSection definiert sind.

Attribute

Beispiele

Im folgenden Codebeispiel wird der Zugriff auf die HttpModuleAction Module veranschaulicht.

C#

// Get the modules collection.
HttpModuleActionCollection httpModules = httpModulesSection.Modules;

// Read the modules information.
StringBuilder modulesInfo = new StringBuilder();
for (int i = 0; i < httpModules.Count; i++)
{
  modulesInfo.Append(
   string.Format("Name: {0}\nType: {1}\n\n", httpModules[i].Name, 
   httpModules[i].Type));
}

Hinweise

Die von dieser Methode zurückgegebene Auflistung verweist nicht auf ein tatsächliches Element in der zugrunde liegenden Konfigurationsdatei. Es handelt sich um ein ASP.NET Infrastrukturkonstrukt, das einen einfachen Zugriff auf die enthaltenen Module ermöglicht. Dies ist ein gängiges Muster für die Verarbeitung der Elemente einer Konfigurationsdatei.

Gilt für:

Produkt Versionen
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Weitere Informationen