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?
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?
You should use System.IO.Directory.GetFiles() and if know the file extension then you should use use System.IO.Directory.GetFiles(@"C:\ MyDirectory*.txt")