© 2019 The Programmator. Theme WPBoot by Just Free Themes.
Today, I came across a situation where I had to generate a password using only a limited set of allowed characters. Since I didn’t really want to reinvent the wheel, I resorted to the
System.Web.Security.Membership class which exposes a GeneratePassword method. Unfortunately, you can’t give it a list of characters to select from.
Venturing into the internets, I ran into this neat script that allows you to pass in a level of complexity. I haven’t investigated the method’s performance thoroughly. It does the job just nicely!