Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class PasswordGenerator
- {
- private const string PasswordChars = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
- public static string GetPassword()
- {
- var random = RandomHelper.GetRandom(); // or new Random(), if you ps-hack coder
- var length = random.Next(10, 16);
- var password = "";
- while (length-- != 0) password += PasswordChars[random.Next(0, PasswordChars.Length - 1)];
- return password;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement