PasswordGenerator.GeneratePassword
GeneratePassword(int length, bool includeLowercase, bool includeUppercase, bool includeDigits, bool includeSpecialChars)
Generates a random password using the specified character types and length.
-
Parameters:
- length: Total number of characters in the generated password. Must be > 0.
- includeLowercase: Whether to include lowercase letters (a–z).
- includeUppercase: Whether to include uppercase letters (A–Z).
- includeDigits: Whether to include digits (0–9).
- includeSpecialChars: Whether to include symbols (!@#$%^&*()-_=+[]{}|;:',.<>?).
-
Returns: string — The generated password.
-
Exceptions:
- ArgumentException if length < 1 or no character sets are selected.