working with Directory class

G

Guest

hi,
i've used Directory.GetFiles(path, "*.*", SearchOption.AllDirectories)
method to
return the files in a given path....

but i've a small concern here...whenever I give path like "d:\", i'm getting
an unauthorizedaccess exception...this is because i'm not able to read certain
directories like 'system volume information'...etc..

is any other alternative? how can i get the file list for a given path?
 
J

Jeff Gaines

hi,
i've used Directory.GetFiles(path, "*.*", SearchOption.AllDirectories)
method to
return the files in a given path....

but i've a small concern here...whenever I give path like "d:\", i'm
getting
an unauthorizedaccess exception...this is because i'm not able to read
certain
directories like 'system volume information'...etc..

is any other alternative? how can i get the file list for a given path?

It.s most likely System Volume Information. I use a try/catch to get round
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top