Sorting a List<FileInfo> by creation date C#
问题 Using this example off MSDN: using System.Collections.Generic; using System.IO; namespace CollectionTest { public class ListSort { static void Main(string[] args) { List<FileInfo> files = new List<FileInfo>(); files.Add(new FileInfo("d(1)")); files.Add(new FileInfo("d")); files.Add(new FileInfo("d(2)")); files.Sort(new CompareFileInfoEntries()); } } public class CompareFileInfoEntries : IComparer<FileInfo> { public int Compare(FileInfo f1, FileInfo f2) { return (string.Compare(f1.Name, f2