i want to sort the files in the listbox based on the time and date

G

Guest

hi, below is the code
pls help me i want the listbox items to be files appeared based on the time
and creation of a file. mean sorting....
thanks

Dim myDirInfo As DirectoryInfo
myDirInfo = New DirectoryInfo("\program
files\SmartDeviceApplication3\InspectionFiles")
Dim myFilenames As FileInfo() = myDirInfo.GetFiles()
Dim myFilename As FileInfo
For Each myFilename In myFilenames
i = i + 1
ListBox1.Items.Add(myFilename.Name)
Next
 

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