HttpModulesSection.Modules Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the HttpModuleActionCollection of HttpModuleAction modules contained by the 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
Property Value
A HttpModuleActionCollection that contains the HttpModuleAction objects, or modules, defined by the HttpModulesSection.
- Attributes
Examples
The following code example shows how to access the 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
Remarks
The collection returned by this method does not refer to any actual element in the underlying configuration file. It is an ASP.NET infrastructure construct that allows easy access to the modules it contains. This is a common pattern for handling the elements of a configuration file.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈