语言

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)

适用于