Friday, September 5, 2014

Getting files by creation date in .NET

using System.Linq;

DirectoryInfo info = new DirectoryInfo("");
FileInfo[] files = info.GetFiles().OrderBy(p => p.CreationTime).ToArray();
foreach (FileInfo file in files)
{
    // DO Something...
}
full credit to original post:
http://stackoverflow.com/questions/4765789/getting-files-by-creation-date-in-net

No comments:

Post a Comment