HttpModulesSection.Modules Eigenschap

Definitie

Haalt de HttpModuleActionCollection modules HttpModuleAction op die zijn opgenomen in de HttpModulesSection.

public:
 property System::Web::Configuration::HttpModuleActionCollection ^ Modules { System::Web::Configuration::HttpModuleActionCollection ^ get(); };
[System.Configuration.ConfigurationProperty("", IsDefaultCollection=true)]
public System.Web.Configuration.HttpModuleActionCollection Modules { get; }
[<System.Configuration.ConfigurationProperty("", IsDefaultCollection=true)>]
member this.Modules : System.Web.Configuration.HttpModuleActionCollection
Public ReadOnly Property Modules As HttpModuleActionCollection

Waarde van eigenschap

Een HttpModuleActionCollection die de HttpModuleAction objecten of modules bevat die zijn gedefinieerd door de HttpModulesSection.

Kenmerken

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u toegang hebt tot de HttpModuleAction modules.


// 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));
}
' Get the modules collection.
Dim httpModules As HttpModuleActionCollection = httpModulesSection.Modules

' Read the modules information.
Dim modulesInfo As New StringBuilder()
For i As Integer = 0 To httpModules.Count - 1
  modulesInfo.Append(String.Format("Name: {0}" + vbLf + "Type: {1}" + vbLf + vbLf, httpModules(i).Name, httpModules(i).Type))
Next

Opmerkingen

De verzameling die door deze methode wordt geretourneerd, verwijst niet naar een werkelijk element in het onderliggende configuratiebestand. Het is een ASP.NET infrastructuurconstructie waarmee u eenvoudig toegang hebt tot de modules die deze bevat. Dit is een veelvoorkomend patroon voor het verwerken van de elementen van een configuratiebestand.

Van toepassing op

Zie ook