Generates a random password of the specified length.
Namespace:
Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 3.2.912.1 (3.2.912.01)
Syntax
C# |
---|
public static string GeneratePassword( int length, int numberOfNonAlphanumericCharacters ) |
Visual Basic (Declaration) |
---|
Public Shared Function GeneratePassword ( _ length As Integer, _ numberOfNonAlphanumericCharacters As Integer _ ) As String |
Parameters
- length
- Type: System..::.Int32
The number of characters in the generated password. The length must be between 1 and 64 characters.
- numberOfNonAlphanumericCharacters
- Type: System..::.Int32
The number of punctuation characters in the generated password.
Return Value
A random password of the specified length.Exceptions
Exception | Condition |
---|---|
System..::.ArgumentException |
length is less than 1 or greater than 64.
- or - numberOfNonAlphanumericCharacters is less than zero or greater than length |