I'm having some problems working in the files in an ordered way using Visual Basic. Basically I'm reading all files in a folder that are named as 1.jpg, 2,jpg, .... 10.jpg, 11.jpg.
When I'm creating my logic I need those files are worked in ascending order by the file name (1,2,3...,8,9,10,11). Actually with my codes the files are being worked as a string way I guess (1,10,2,20,3,4,5).
Can someone help me in this case since I can't get it working? Tried two different codes but can't reach the solution.
I've tried with:
Dim MyFiles() As String = IO.Directory.GetFiles(folder)
For Each file In myfiles
And also tried with:
Dim myfiles As FileInfo()
myfiles = New DirectoryInfo(folder).GetFiles()
For Each file In myfiles
Can someone help me please?