FormsAuthenticationUserCollection.Item[] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the specified FormsAuthenticationUser collection item.
Overloads
Item[Int32] |
Gets the FormsAuthenticationUser at the specified index. |
Item[String] |
Gets the FormsAuthenticationUser with the specified name. |
Item[Int32]
Gets the FormsAuthenticationUser at the specified index.
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
Parameters
- index
- Int32
The collection user's index.
Property Value
A FormsAuthenticationUser that contains the user name and password.
Examples
The following code example shows how to access the credentials of a user at the specified index.
// 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)
Applies to
Item[String]
Gets the FormsAuthenticationUser with the specified name.
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
Parameters
- name
- String
The user's name.
Property Value
A FormsAuthenticationUser object that contains the user name and password.
Examples
The following code example shows how to access the credentials of a user with the specified name.
// 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")
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈