// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Text; class MainClass { private static Random rng = new Random(); public static string newPassword(int l) { char[] valid = { 'A', 'B', 'C', '2', '3', '4' }; StringBuilder sb = new StringBuilder(""); for(int i = 0; i < l; i++) { sb.Append(valid[rng.Next(valid.Length)]); } return sb.ToString(); } public static void Main(string[] args) { for(int i = 0; i < 10; i++) { string brugernavn = newPassword(6); string kodeord = newPassword(6); Console.WriteLine(brugernavn + " " + kodeord); } } }