Reputation: 107
What would be a suitable way to count how many folders are in a specific directory (not counting sub-folders or files within those folders, just the count of the folders in the specified directory).
I have looked around the Internet but could not find a suitable example.
Thanks.
Upvotes: 0
Views: 1272
Reputation: 3007
It's as simple as this
Dim folderCount As Integer = IO.Directory.GetDirectories("c:\your_direcrory").Count()
Upvotes: 3