語言

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 一個名稱與類型的模組。 接著你可以用這個模組物件取得它的集合索引。

適用於