Simplest example:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
FindFiles("c:\", "*.doc")
End Sub
Private Sub FindFiles(ByVal pathToSearch As String, ByVal filter As String)
Dim fi As System.IO.FileInfo
Dim di As System.IO.DirectoryInfo
Dim subDI As System.IO.DirectoryInfo
di = New System.IO.DirectoryInfo(pa
For Each fi In di.GetFiles(filter)
' do something with fi...
Debug.WriteLine(fi.FullNam
Next
For Each subDI In di.GetDirectories
FindFiles(subDI.FullName, filter)
Next
End Sub
Main Topics
Browse All Topics





by: heintalusPosted on 2005-08-07 at 15:42:25ID: 14619885
Take a look at the following post, you'll find code there to recursively go through all files & subdirectories in a specified folder copying them to a new location. You'll be able to get what you need from it.
e.com/Prog ramming/ Pr ogramming_ Languages/ Dot_Net/VB _DOT_NET/Q _21406518. html
http://www.experts-exchang
If you dont understand anything then just ask & i'll explain further
HTH
Andy