XK8ER
asked on
vb.net - sub directories issue
hello there,
I have about 3500 files, all in sub directories.
I am trying to get the full path for each of the files but this code only shows about 235 files and it wont show the full path.
how can I get the full path for all 3,500 files?
I have about 3500 files, all in sub directories.
I am trying to get the full path for each of the files but this code only shows about 235 files and it wont show the full path.
how can I get the full path for all 3,500 files?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
lvCount.Text = 0
If txtPath.Text <> "" Then
Call leGetFiles(txtPath.Text)
Else
Debug.Print("You need to specify a directory")
End If
End Sub
Private Sub leGetFiles(ByVal strDir As String)
Dim qFiles = IO.Directory.GetDirectories(strDir)
Dim xFiles = IO.Directory.GetFiles(strDir)
For Each strFile In xFiles
Debug.Print(strFile)
lvCount.Text = Val(lvCount.Text) + 1
Next
Dim qDirs = IO.Directory.GetDirectories(strDir)
For Each y In qDirs
Dim subFiles = IO.Directory.GetFiles(IO.Path.Combine(strDir, y))
For Each strFile In qFiles
Debug.Print(strFile)
lvCount.Text = Val(lvCount.Text) + 1
Next
Next
End Sub
ASKER
its not working because its showing 235 files only
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you must have sub directories within the sub directories. If this is the case and you want to include these as well, what is the depth of your search? i.e how deep is the directory structure?
ASKER
about 8 sud dirs
Open in new window