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));

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Crop white space from around the image