FormsAuthenticationUserCollection.Item[] 属性

定义

获取指定的 FormsAuthenticationUser 集合项。

重载

Item[Int32]

获取位于指定索引处的 FormsAuthenticationUser

Item[String]

获取具有指定名称的 FormsAuthenticationUser

Item[Int32]

获取位于指定索引处的 FormsAuthenticationUser

public:
 property System::Web::Configuration::FormsAuthenticationUser ^ default[int] { System::Web::Configuration::FormsAuthenticationUser ^ get(int index); void set(int index, System::Web::Configuration::FormsAuthenticationUser ^ value); };
public System.Web.Configuration.FormsAuthenticationUser this[int index] { get; set; }
member this.Item(int) : System.Web.Configuration.FormsAuthenticationUser with get, set
Default Public Property Item(index As Integer) As FormsAuthenticationUser

参数

index
Int32

集合用户的索引。

属性值

FormsAuthenticationUser

包含用户名和密码的 FormsAuthenticationUser

示例

下面的代码示例演示如何在指定的索引处访问用户的凭据。

// Get the user element at the specified index.
FormsAuthenticationUser storedUser3 = 
    formsAuthenticationCredentials.Users[0];
' Get the user element at the specified index.
  Dim storedUser3 As FormsAuthenticationUser = _
  formsAuthenticationCredentials.Users(0)

适用于

Item[String]

获取具有指定名称的 FormsAuthenticationUser

public:
 property System::Web::Configuration::FormsAuthenticationUser ^ default[System::String ^] { System::Web::Configuration::FormsAuthenticationUser ^ get(System::String ^ name); };
public System.Web.Configuration.FormsAuthenticationUser this[string name] { get; }
member this.Item(string) : System.Web.Configuration.FormsAuthenticationUser
Default Public ReadOnly Property Item(name As String) As FormsAuthenticationUser

参数

name
String

用户名。

属性值

FormsAuthenticationUser

包含用户名和密码的 FormsAuthenticationUser 对象。

示例

下面的代码示例演示如何访问具有指定名称的用户的凭据。

// Get the user element with the specified name.
FormsAuthenticationUser storedUser4 = 
    formsAuthenticationCredentials.Users["userName"];
' Get the user element with the specified name.
  Dim storedUser4 As FormsAuthenticationUser = _
  formsAuthenticationCredentials.Users("userName")

适用于