Hi... Use below Query to get your desired files type collection:
- string FolderPath = @"D:\AllFiles";
- DirectoryInfo di = new DirectoryInfo(FolderPath)
- //Get All csv Files
- List getAllCSVFiles = di.GetFiles("*.csv")
- .Where(file => file.Name.EndsWith(".csv"))
- .Select(file => file.Name).ToList();
- //Get All Notepad Files
- List getAllNotePadFiles = di.GetFiles("*.txt")
- .Where(file => file.Name.EndsWith(".txt"))
- .Select(file => file.Name).ToList();

Pavan BujjiPosted Sep 25, 2017, 3:46 AM
In the LIST "getALLCSVFiles".How to find the last file name and path ?.Please inform me bro.
Gowtham RajamanickamPosted Mar 13, 2015, 2:06 AM
Good one...