Sorting Files in Directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to sort files in a specified folder by their creation date and then
display their names (sorted by the creation date) in a textbox for example.
How would you do that?

Dim dir As New DirectoryInfo("C:\myFldr")
Dim myfile As FileInfo
For Each myfile In dir.GetFiles("*.*")
...
Next
 
Amjad said:
I want to sort files in a specified folder by their creation date and then
display their names (sorted by the creation date) in a textbox for
example.

Get an array of 'FileInfo' objects and then sort them by create-date.
Maybe you'll have to write your own 'Comparer'.
 
Back
Top