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.
Code:
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.