Only use selected character groups to generate the password

  • Homepage
  • Software
  • Thoughts and Ideas
  • Photos and Art
  • Contact

If you don't want to include all characters in the generated password, but for example only numbers and lowercase characters, you need to combine the various password options by a logical OR. The following example shows this.

using CAM.PasswordGeneratorLibrary;
...
PasswordGenerator pwdGen = 
  new RandomPasswordGenerator(PasswordOptions.Numbers | 
    PasswordOptions.LowercaseCharacters);

Console.WriteLine(pwdGen.Generate(8));
© Christoph A. Müller - Contact/Imprint - Privacy