using System;using System.IO;class GFG{public static void Main(string[] args){ Random res = new Random(); String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; String FileText = ""; 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]; } FileText = FileText + $"{randomstring}\n"; Console.WriteLine("Random alphanumeric String:" + randomstring); } string file = @"codes.txt"; File.WriteAllText(file, FileText );}}