hi,
I want to add to a listbox the full paths of the files in a directory AND the files in subdirectories.
e.g : c:\test\abc.xls
c:\test\aaa.exe
c:\test\1\2\asd.doc
...
(the folder "c:\test\1" has no files in it)
Tried this:
It hasn't the result I want because it checks the DIRECTORIES only in "c:\test". If there is a file in "c:\test\asd.exe";it won't be added to the listbox.
Any ideas?
I want to add to a listbox the full paths of the files in a directory AND the files in subdirectories.
e.g : c:\test\abc.xls
c:\test\aaa.exe
c:\test\1\2\asd.doc
...
(the folder "c:\test\1" has no files in it)
Tried this:
Code:
Dim dirs() As String = Directory.GetDirectories("c:\test")
For Each dir As String In dirs
Dim dirs1() As String = Directory.GetFiles(dir)
For Each dir1 As String In dirs1
ListBox1.Items.Add(dir1)
Next
Next
It hasn't the result I want because it checks the DIRECTORIES only in "c:\test". If there is a file in "c:\test\asd.exe";it won't be added to the listbox.
Any ideas?