HttpModuleActionCollection.IndexOf(HttpModuleAction) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得指定 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 一個名稱與類型的模組。 接著你可以用這個模組物件取得它的集合索引。