Export (0) Print
Expand All

MembershipProvider.EncryptPassword Method (Byte[], MembershipPasswordCompatibilityMode)

.NET Framework 4.6 and 4.5

Encrypts the specified password using the specified password-compatibility mode.

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

protected virtual byte[] EncryptPassword(
	byte[] password,
	MembershipPasswordCompatibilityMode legacyPasswordCompatibilityMode
)

Parameters

password
Type: System.Byte[]

A byte array that contains the password to encrypt.

legacyPasswordCompatibilityMode
Type: System.Web.Configuration.MembershipPasswordCompatibilityMode

The membership password-compatibility mode.

Return Value

Type: System.Byte[]
A byte array that contains the encrypted password.

ExceptionCondition
ProviderException

The ValidationKey property or DecryptionKey property is set to AutoGenerate.

PlatformNotSupportedException

This method is not available. This can occur if the application targets the .NET Framework 4 Client Profile. To prevent this exception, override the method, or change the application to target the full version of the .NET Framework.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft