Directory.getFilesで数値順でのソートができません。
dirNow = "C:\car";
fileNames[0] = "C:\car\1.txt";
fileNames[1] = "C:\car\2.txt";
fileNames[2] = "C:\car\3.txt";
fileNames[3] = "C:\car\10.txt";
string[] fileNames = Directory.GetFiles(dirNow);
Array.Sort(fileNames);
foreach(string str in fileNames) Console.WriteLine(str);
Application.Exit();
結果
1.txt
10.txt
2.txt
3.txt
理想
1.txt
2.txt
3.txt
10.txt