2

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.

Hyun
  • 37
  • 8

1 Answers1

2

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

Ashok Patel
  • 120
  • 8