I have the following snippet of code:
Public MyCollection As New List(Of String)
Private Function GetFiles(ByVal strPath As String, ByVal searchList As List(Of String)) As List(Of String)
Dim matches As New List(Of String)
For Each pattern As String In searchList
matches.AddRange(System.IO.Directory.GetFiles(strPath, pattern))
Next
Return matches
End Function
Private Sub GetMyFiles(ByVal strPath As String)
Dim SupportedFormats As New List(Of String)
With SupportedFormats
.Add("*.txt")
.Add("*.doc")
End With
MyCollection.AddRange(Module1.GetFiles(strPath, SupportedFormats))
Dim DI As New System.IO.DirectoryInfo(strPath)
For Each d As System.IO.DirectoryInfo In DI.GetDirectories
Console.Writeline(d.Fullname)
Module1.GetMyFiles(d.FullName)
Next d
End Sub
Can someone please ...
Go to the complete details ...