How to generate a random password of fixed length in ASP.net (no GUID) ? After generating the random password, I need to email the password to the specified user.
In the System.Web.Security namespace you'll find a way to generate passwords:
string pw = Membership.GeneratePassword(8, 1);
You can provide the length of the password in the first parameter. The second is to indicate the minimum number of non-alphanumeric characters in the generated password.
MSDN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With