Reputation: 37
Using 'Directory.GetDirectories().Length'
Except for an UnauthorizedAccessexception folder, How can I get the number of folders? I would like to get only the number of Accessible folder.
sorry, I can't speaking english well.
Upvotes: 2
Views: 198
Reputation: 120
using Directory.GetDirectories() you can get a list of directories and then check permission for each directory and if it's allowed than take one counter for a number of the accessible folders.
To check permission on folder go to the following link. Visit Checking for directory and file write permissions in .NET
Upvotes: 2