HttpModulesSection.Modules Egenskap

Definition

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

Egenskapsvärde

En HttpModuleActionCollection som innehåller de HttpModuleAction objekt eller moduler som definieras av HttpModulesSection.

Attribut

Exempel

Följande kodexempel visar hur du kommer åt modulerna HttpModuleAction .


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

Kommentarer

Samlingen som returneras med den här metoden refererar inte till något faktiskt element i den underliggande konfigurationsfilen. Det är en ASP.NET infrastrukturkonstruktion som ger enkel åtkomst till de moduler som den innehåller. Det här är ett vanligt mönster för hantering av elementen i en konfigurationsfil.

Gäller för

Se även