Try Dim Root As New DirectoryInfo("SearchPath eg. C:\") Dim Dirs As DirectoryInfo() = Root.GetDirectories("*.*", SearchOption.AllDirectories) Dim count As Integer = Dirs.Length For Each DirectoryName In Dirs Label12.Text = count Next Catch ex As UnauthorizedAccessException End Try
Directory.GetDirectories("c:\")
DirectoryInfo
DirectoryInfo("C:\")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)