|
Subject:
|
Finding Files
|
|
Posted By:
|
snowy0
|
Post Date:
|
10/10/2004 9:06:25 PM
|
In my program I want to be able to search for all the executable files in a selected folder and all of it's subfolders. I have a list box (lstFiles) that displays the files and a text box in which the directory to search in is stored (txtDirectory). This is my code. It only searches through the selected folder. It does not search subfolders.
Dim Files() As FileInfo
Files = New DirectoryInfo(txtDirectory.Text).GetFiles("*.exe")
Dim File As FileInfo
For Each File In Files
lstFiles.Items.Add(File.FullName)
Next
Thanks in advance.
|
|
Reply By:
|
katsarosj
|
Reply Date:
|
10/12/2004 1:00:59 PM
|
Use a recursive procedure to get the items in the subfolders.
J
|