This code is the code that lets the user select the folder and display it in the textbox
Private Sub SourceButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SourceButton.Click
With SourceBrowse
If .ShowDialog = DialogResult.OK Then
SourcePath.Text = .SelectedPath
End If
End With
End Sub
This code is the function I found and tweaked to recursively search a folder
Private Function RecursiveSearch(ByVal path As String) As Boolean
Dim dirInfo As New IO.DirectoryInfo(path)
Dim fileObject As FileSystemInfo
For Each fileObject In dirInfo.GetFileSystemInfos()
If (fileObject.Attributes And FileAttributes.Directory) = FileAttributes.Directory Then
RecursiveSearch(fileObject.FullName)
Else
Console.WriteLine(fileObject.FullName)
End If
Next
Return True
End Function
On a side note I also want the list to display all the files in the folder as well.
This post has been edited by astroshark: 30 March 2011 - 01:42 AM

New Topic/Question
Reply




MultiQuote



|