Share via


AuthorizationRuleCollection.IndexOf(AuthorizationRule) 方法

定义

获取指定的 AuthorizationRule 对象的集合索引。

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

参数

rule
AuthorizationRule

其索引被返回的 AuthorizationRule 对象。

返回

指定的 AuthorizationRule 对象的索引。

示例

下面的代码示例说明如何使用 IndexOf 方法。

// Get the rule collection index.
System.Int32 ruleIndex = 
    authorizationSection.Rules.IndexOf(authorizationRule);
' Get the rule collection index.
  Dim ruleIndex As System.Int32 = _
  authorizationSection.Rules.IndexOf(authorizationRule)

适用于