Public Class Form1
Private fileList As New List(Of String)
Sub getFiles(ByVal folderPath As String)
Try
For Each folder As String In System.IO.Directory.GetDirectories(folderPath)
getFiles(folder)
Next
fileList.AddRange(System.IO.Directory.GetFiles(folderPath, "*.xls").ToList)
Catch ex As Exception : End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each folder As String In IO.Directory.GetDirectories("Z:\Reports\Jet Reports\", "*.*")
getFiles(folder)
Next
Stop 'check the fileList now
End Sub
End Class
|