It's simply a recursive procedure, starting at the root and recursing
through sub-directories - you can maintain a collection of "found" items as
you go....:
Public Sub Scan (ByVal theFoundItems as ArrayList, ByVal theRoot as String)
Scan_Aux ( theFoundItems, theRoot )
End Sub
Public Sub Scan_Aux ( ByVal theFoundItems As ArrayList, ByVal theRoot As
String)
' First recurse through to the leaves....
Dim theDirectories() As String = Directory.GetDirectories ( theRoot )
For Each theDirectory As String In theDirectories
Scan_Aux ( theFoundItems, theDirectory )
Next
' Now scan the files in the current directory for any that match...
Dim theFiles() As String = Directory.GetFiles ( theRoot )
For Each theFile As String In theFiles
If ....<the file matches our criteria> Then
theFoundItems.Add theFile
End If
Next
End Sub
"Treasure Baloyi" <Tr************@discussions.microsoft.com> wrote in
message news:48**********************************@microsof t.com...
Greetings unto thee.
I want to know how to write an application in vb.net that will search my
computer for files.
An example: Windows Media Player has an option to search your pc for media
files and import them to its media library.
I want to know how to do that (the searching part, not the importing)
Your assistance in this regrard will be utmost appreciated.
--
TTB