Click or drag to resize
PasswordGenerate Method
Generates a random password of the specified length.

Namespace: CMS.Membership.Security
Assembly: CMS.Membership (in CMS.Membership.dll) Version: 13.0.131
Syntax
C#
public static string Generate(
	int length,
	int numberOfNonAlphanumericCharacters
)

Parameters

length
Type: SystemInt32
The number of characters in the generated password. The length must be between 1 and 128 characters.
numberOfNonAlphanumericCharacters
Type: SystemInt32
The minimum number of non-alphanumeric characters (such as @, #, !, %, &, and so on) in the generated password.

Return Value

Type: String
A random password of the specified length.
Exceptions
ExceptionCondition
ArgumentException Thrown when length is less than 1 or greater than 128 -or- numberOfNonAlphanumericCharacters is less than 0 or greater than length.
See Also