private static void GetFileDates()
{
DirectoryInfo di = new DirectoryInfo(_path);
FileSystemInfo[] files = di.GetFileSystemInfos();
var orderedFiles = files.OrderBy(f => f.LastWriteTime);
FileSystemInfo first = (FileSystemInfo)orderedFiles.First();
FileSystemInfo last = (FileSystemInfo)orderedFiles.Last();
_startDate = first.LastWriteTime.ToString();
_stopDate = last.LastWriteTime.ToString();
}
No comments:
Post a Comment