Hi
I have the following code that will list all directories and sub directories
What iam trying to achive is to get the file count for each directory or sub directory.
Example of how the listbox should look
c:\tools = 0
c:\tools\test1 = 23
etc...
Any help would be appreciated
Thanks
I have the following code that will list all directories and sub directories
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim DirList As New ArrayList
GetDirectories("C:\Tools", DirList)
End Sub
Sub GetDirectories(ByVal StartPath As String, ByRef DirectoryList As ArrayList)
Dim Dirs() As String = Directory.GetDirectories(StartPath)
DirectoryList.AddRange(Dirs)
For Each Dir As String In Dirs
GetDirectories(Dir, DirectoryList)
ListBox2.Items.Add(Path.GetDirectoryName(Dir))
Next
End Sub
Example of how the listbox should look
c:\tools = 0
c:\tools\test1 = 23
etc...
Any help would be appreciated
Thanks