Wednesday, December 28, 2016

Get all file info from the folder using C# code


Here is the code snippet to get all the file information from a folder in the descending order of creation date and time.


var dirInfo = new DirectoryInfo(folderNametoSearch);

FileInfo[] filesInfo = dirInfo.GetFiles().OrderByDescending(p => p.CreationTime).ToArray();

 

No comments:

Post a Comment

All Blogs so far ...