private static Random rnd = new Random();
public static void Main()
Console.WriteLine(CreateRandomPassword(6));
private static string CreateRandomPassword(int passwordLength)
string allowedChars = "ACEFHJKLMNPQRTUXY3479";
char[] chars = new char[passwordLength];
for (int i = 0; i < passwordLength; i++)
chars[i] = allowedChars[rnd.Next(0, allowedChars.Length)];
return new string(chars);