var files = Directory.GetFiles(@"C:\Users\user\Downloads\CaptchaCollection\Small").OrderBy(name => name).ToArray();
for (int i = 0; i < files.Length; i++)
{
MessageBox.Show(files[i].ToString());
}
So I was testing my files array with the message box but it seems like it's not giving the name in order.
My file names are n.png, where n is a number. There is no pattern since I deleted some images.
So here is the output so far:
1
1001
1006
1008
1009
101
1016
1017
1019
1026
....
Normally in ascending order manually I'd get something like:
1
2
4
5
7
...
How do I sort this array so that everything is in numeric order??