sorting by file size

DirectoryInfo dir = new DirectoryInfo("K:\\VGD-103");
FileInfo[] files= dir.GetFiles("*.rar");

Array.Sort(files, (f1, f2) => f1.Length.CompareTo(f2.Length));    //排序檔案大小

foreach (FileInfo f in files)
    Console.WriteLine("{0}\t{1}",f.Name,f.Length/1024);

system.io - How to sort an array of FileInfo[] C# - Stack Overflow