in order to get all the directories in the "main" directory use:
Code:
' make a reference to a directory
Dim di As New IO.DirectoryInfo(DriveLetter & ":\")
Dim diar1 As IO.DirectoryInfo() = di.GetDirectories
Dim dra As IO.DirectoryInfo
'list the names of all directories in the base drive
For Each dra In diar1
MessageBox.Show(dra.ToString)
Next
End Sub
of course you can change it so it uses a listbox instead of a messagebox or whatnot, but that will show all the base directories.
one change to make tho, is the Io.DirectoryInfo should be the drive letter... ie.
instead of:
Code: Dim di as new IO.DirectoryInfo(DriveLetter & ":\")
you should write:
Code: Dim di as new IO.DirectoryInfo("C:\")
substituting C:\ for the drive of your choice.
NOTE: This does not get the subdirectories. I'm going to work on some code to do that.