using System;using System.IO;class GFG{public static void Main(string[] args){ Random res = new Random(); String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; String randomstring = ""; for (int i = 0; i < 1000; i++){ for (int a = 0; a < 7; a++) { int x = res.Next(str.Length); randomstring = randomstring + str[x]; } string file = @"codes.txt"; File.WriteAllText(file, $"{randomstring}\n"); Console.WriteLine("Random alphanumeric String:" + randomstring); }}}