Edit

Share via


FormsAuthentication.HashPasswordForStoringInConfigFile(String, String) Method

Definition

Caution

The recommended alternative is to use the Membership APIs, such as Membership.CreateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.

Produces a hash password suitable for storing in a configuration file based on the specified password and hash algorithm.

public static string HashPasswordForStoringInConfigFile(string password, string passwordFormat);
[System.Obsolete("The recommended alternative is to use the Membership APIs, such as Membership.CreateUser. For more information, see http://go.microsoft.com/fwlink/?LinkId=252463.")]
public static string HashPasswordForStoringInConfigFile(string password, string passwordFormat);

Parameters

password
String

The password to hash.

passwordFormat
String

The hash algorithm to use. passwordFormat is a String that represents one of the FormsAuthPasswordFormat enumeration values.

Returns

The hashed password.

Attributes

Exceptions

password is null

-or-

passwordFormat is null.

passwordFormat is not a valid FormsAuthPasswordFormat value.

Remarks

This method is obsolete. Alternatively, you can use ASP.NET membership to store user credentials. For more information, see Managing Users by Using Membership.

Applies to

Product Versions (Obsolete)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0 (4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1)