Guid g = Guid.NewGuid(); string s = g.ToString("D");
private static string CreateRandomPassword(int passwordLength) { string allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789!@$?_-"; char[] chars = new char[passwordLength]; Random rd = new Random(); for (int i = 0; i < passwordLength; i++) { chars[i] = allowedChars[rd.Next(0, allowedChars.Length)]; } return new string(chars); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)