Table of Contents

Class Passwords

Namespace
Tripous
Assembly
Tripous.dll

Static class for generating and validating passwords.

public static class Passwords
Inheritance
Passwords
Inherited Members

Fields

SpecialChars

Special characters.

public static readonly string SpecialChars

Field Value

string

Methods

GeneratePassword(int, bool, bool, bool, bool)

Generates a random password and guarantees that each selected character category appears at least once.

public static string GeneratePassword(int MinLength = 12, bool UseUpperCase = true, bool UseLowerCase = true, bool UseNumbers = true, bool UseSpecialChars = false)

Parameters

MinLength int
UseUpperCase bool
UseLowerCase bool
UseNumbers bool
UseSpecialChars bool

Returns

string

IsValid(string, int, int, bool, bool, bool, bool)

Validates a password, according to specified requirements regarding its content and length, and returns the result.

public static bool IsValid(string Password, int MinLength = 8, int MaxLength = 12, bool UseLowerChars = true, bool UseUpperChars = true, bool UseDigitChars = true, bool UseSpecialChars = true)

Parameters

Password string
MinLength int
MaxLength int
UseLowerChars bool
UseUpperChars bool
UseDigitChars bool
UseSpecialChars bool

Returns

bool