Wednesday, 22 September 2010

C# List sorting

DirectoryInfo dir = new DirectoryInfo(@"C:\temp");
List<FileInfo> files = new List<FileInfo>(dir.GetFiles());
files.Sort((x, y) => DateTime.Compare(x.LastWriteTime,y.LastWriteTime));

No comments:

Post a Comment