Answers for "Directory.GetFiles sorted by name"

0

Directory.GetFiles sorted by name

var sorted = Directory.GetFiles(".").OrderBy(f => f);
Posted by: Guest on December-02-2020
0

Directory.GetFiles(folder, "*.dll").Select(fn => new FileInfo(fn)).OrderBy

[System.Runtime.InteropServices.DllImport("Shlwapi.dll", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
private static extern int StrCmpLogicalW(string psz1, string psz2);
DirectoryInfo di = new DirectoryInfo(path);
FileInfo[] arrFi = di.GetFiles("*.*");
Array.Sort(arrFi, delegate(FileInfo x, FileInfo y) { return StrCmpLogicalW(x.Name, y.Name); });
Posted by: Guest on November-30-2020

Browse Popular Code Answers by Language