FormsAuthenticationUser.Password Property

 

Gets or sets the user's password.

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

[ConfigurationPropertyAttribute("password", IsRequired = true, 
	DefaultValue = "")]
[StringValidatorAttribute]
public string Password { get; set; }

Property Value

Type: System.String

The user's password required by the application.

The following code example shows how to use the Password property. Refer to the code example in the FormsAuthenticationUser class topic to learn how to get the section.


// Using the Password property.

// Get current password.
string currentPassword = 
    formsAuthenticationUsers[0].Password;

// Set a SHA1 encrypted password.
formsAuthenticationUsers[0].Password =
    "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";

.NET Framework
Available since 2.0
Return to top
Show: