Generates a random password of the specified length.
Namespace: CMS.Membership.SecurityAssembly: CMS.Membership (in CMS.Membership.dll) Version: 13.0.131
Syntax 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:
StringA random password of the specified length.
Exceptions Exception | Condition |
---|
ArgumentException |
Thrown when
length is less than 1 or greater than 128
-or-
numberOfNonAlphanumericCharacters is less than 0 or
greater than length.
|
See Also