static void Main(string[] args) { var directory = new DirectoryInfo(@"C:\Temp"); //check temp folder in c drive var filePaths = directory.GetFiles("*.txt"); //get txt files }