日期:2014-05-18 浏览次数:20861 次
using System; using System.Collections.Generic; using System.Text; using System.IO; namespace ConsoleApplication1 { class Program { static void Main() { string path = @"E:\Movie"; FileInfo[] files = new DirectoryInfo(path).GetFiles(); List<FileInfo> list = new List<FileInfo>(files); list.Sort(new Comparison<FileInfo>(delegate(FileInfo a, FileInfo b) { return a.CreationTime.CompareTo(b.CreationTime); })); foreach (FileInfo f in list) { Console.WriteLine(f.Name + "," + f.CreationTime); } } } }