I have a folder D:\MyDirectory that is full of tab-delimited text files, but the number of files is unknown at any given time. How Can I read and store the names of the text files in the MyDirectory directory into an array?
How can I read all files in a directory to an array using C#?
215205-Oct-2013
Hank Greenberg
05-Oct-2013You should use System.IO.Directory.GetFiles() and if know the file extension then you should use use System.IO.Directory.GetFiles(@"C:\ MyDirectory*.txt")