Generates a random password of the specified length.
Namespace: Novalys.VisualGuard.SecurityAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
public static string GeneratePassword( int length, int numberOfNonAlphanumericCharacters ) |
Visual Basic |
---|
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
Type: StringA 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 |