Επεξεργασία

Κοινή χρήση μέσω


ActiveDirectoryMembershipProvider.GeneratePassword Method

Definition

Generates a random password.

public:
 virtual System::String ^ GeneratePassword();
public virtual string GeneratePassword ();
abstract member GeneratePassword : unit -> string
override this.GeneratePassword : unit -> string
Public Overridable Function GeneratePassword () As String

Returns

A random password.

Remarks

The GeneratePassword method of the ActiveDirectoryMembershipProvider class calls the GeneratePassword method of the Membership class to retrieve a random password. The password length is set to the value of the MinRequiredPasswordLength property. The password length can never be less than 14.

You can specifically call the GeneratePassword method by referencing the ActiveDirectoryMembershipProvider class directly from the Provider property of the Membership class.

The generated password only contains alphanumeric characters and the following punctuation marks: !@#$%^&*()_-+=[{]};:<>|./?. No hidden or non-printable control characters are included in the generated password.

The generated password will contain at least the number of non-alphanumeric characters specified in the MinRequiredNonAlphanumericCharacters property. The generated password will not be tested with the regular expression in the PasswordStrengthRegularExpression property.

Note

The ActiveDirectoryMembershipProvider class does not generate passwords that match complexity requirements set in the directory. It is possible to generate a random password that fails the password complexity rules set by the directory.

Applies to

See also