Sorting Files in Directory

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
 
H

Herfried K. Wagner [MVP]

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'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top