FormsAuthenticationUserCollection.GetKey Method (Int32)


Gets the key at the specified FormsAuthenticationUserCollection collection index.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public string GetKey(
	int index


Type: System.Int32

The index in the collection.

Return Value

Type: System.String

The key at the specified index of the FormsAuthenticationUserCollection.

The following code example shows how to use the GetKey method.

// Get the key at the specified index.
string thisKey = formsAuthenticationCredentials.Users.GetKey(0).ToString();

.NET Framework
Available since 2.0
Return to top