I want to get all of the files in a directory in an array (including the files in subfolders)
string[] filePaths = Directory.GetFiles(@\"c:\\\",SearchOption.
or try this one :
DirectoryInfo dirs = new DirectoryInfo(@"c:\");
List filenames = (from i in dirs.GetFiles("*", SearchOption.AllDirectories)
select i.Name).ToList();
or file names without extension :
DirectoryInfo dirs = new DirectoryInfo@"c:\");
List filenames = (from i in dirs.GetFiles("*", SearchOption.AllDirectories)
select System.IO.Path.GetFileNameWithoutExtension(i.Name)).ToList();