System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile Method

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

Syntax

public static string HashPasswordForStoringInConfigFile (string password, string passwordFormat)

Parameters

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

Returns

The hashed password.

Remarks

The FormsAuthentication.HashPasswordForStoringInConfigFile(string, string) method creates a hashed password value that can be used when storing forms-authentication credentials in the configuration file for an application.

Authentication credentials stored in the configuration file for an application are used by the FormsAuthentication.Authenticate(string, string) method to verify passwords for users of an application. Alternatively, you can use ASP.NET membership to store user credentials. For more information, see Managing Users Using ASP.NET Membership.

Requirements

Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0