Share via


HttpModuleActionCollection.IndexOf(HttpModuleAction) 方法

定义

获取指定的 HttpModuleAction 模块的集合索引。

public:
 int IndexOf(System::Web::Configuration::HttpModuleAction ^ action);
public int IndexOf (System.Web.Configuration.HttpModuleAction action);
member this.IndexOf : System.Web.Configuration.HttpModuleAction -> int
Public Function IndexOf (action As HttpModuleAction) As Integer

参数

action
HttpModuleAction

要获取其集合索引的 HttpModuleAction 模块。

返回

指定的模块的集合索引值。

示例

以下示例演示如何获取 HttpModuleAction 模块集合索引。

// Set the module object.
HttpModuleAction ModuleAction1 = 
    new HttpModuleAction("MyModule1Name",
    "MyModule1Type");
// Get the module collection index.
int moduleIndex = modulesCollection.IndexOf(ModuleAction1);

' Set the module object.
Dim ModuleAction1 _
As New HttpModuleAction( _
"MyModule1Name", "MyModule1Type")
' Get the module collection index.
Dim moduleIndex As Integer = _
modulesCollection.IndexOf(ModuleAction1)

注解

在使用此方法之前,必须使用正确的名称和类型标识 HttpModuleAction 模块。 然后,可以使用此模块对象获取其集合索引。

适用于