Selecting a random name from a txt file using c#
made a program that reads a txt file and displays the text in the console, having trouble figuring out how to randomly display one of the names in the txt file though any help?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Banketeshvar NarayanRank #235 · 10.5K reputationPosted Nov 8, 2015, 12:19 AM EST
string[] fileList = Directory.GetFiles(@"D:\RandomFiles", "*.txt");
string fileToRead = fileList[r.Next(0, fileList.Length)];