HttpModuleActionCollection.Add(HttpModuleAction) 方法

定义

HttpModuleAction 对象添加到集合。

public:
 void Add(System::Web::Configuration::HttpModuleAction ^ httpModule);
public void Add (System.Web.Configuration.HttpModuleAction httpModule);
member this.Add : System.Web.Configuration.HttpModuleAction -> unit
Public Sub Add (httpModule As HttpModuleAction)

参数

httpModule
HttpModuleAction

要添加到集合中的 HttpModuleAction 模块。

例外

尝试添加一个集合中已经存在的 HttpModuleAction 对象。

示例

以下示例演示如何创建对象 HttpModuleAction 并将其添加到集合。

// Create a new module object.

HttpModuleAction ModuleAction = 
    new HttpModuleAction("MyModuleName", 
    "MyModuleType");
// Add the module to the collection.
if (!httpModulesSection.SectionInformation.IsLocked)
{
    modulesCollection.Add(ModuleAction);
    configuration.Save();
}
' Create a new module object.
  Dim ModuleAction As New HttpModuleAction( _
  "MyModuleName", "MyModuleType")
  ' Add the module to the collection.
  If Not httpModulesSection.SectionInformation.IsLocked Then
      modulesCollection.Add(ModuleAction)
      configuration.Save()
  End If

注解

HttpModuleAction 对象添加到集合。

适用于