Unauthorized access exception problem

I am using

files = System.IO.Directory.GetFiles(dPath, "*.txt", IO.SearchOption.AllDirectories)

to get a list of all txt files in this case, but if I set dpath to" C:\" for instance it throws an Unauthorized access exception .. which I understand.. but I would like it to continue to process the unprotected folders without crashing..

any ideas please?
LVL 1
chrisfixitAsked:
Who is Participating?
 
Jorge PaulinoIT Pro/DeveloperCommented:
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.