this is my code
Dim orderedFiles = New System.IO.DirectoryInfo(dir).GetFiles("file_*.jpeg").OrderBy(Function(x) x.Name)
For Each f As System.IO.FileInfo In orderedFiles
msgbox(f.name)
Next
display
file_1.jpeg
file_10.jpeg
file_11.jpeg
file_12.jpeg
file_13.jpeg
file_14.jpeg
file_2.jpeg
file_3.jpeg
file_4.jpeg
file_5.jpeg
file_6.jpeg
file_7.jpeg
file_8.jpeg
file_9.jpeg
i want them to sort 1 - 2 - 3 ...... 14
how can i do it?
1followed by10is the correct order. The usual way to fix this issue is to add zeros on the left of the numbers that are a single digit, as in01, which will allow them to sort in the order you want. If that doesn't work for you, you're going to have to write your own code to do the sorting.StrCmpLogicalW.000000e.g000001and000010now everything is fine. thank you everyone