I want to retrieve some pictures from MyDocuments folder, but my Try-Catch structure stopped me.
This is my code:
try
{
string[] images = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "*.png", SearchOption.AllDirectories);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
This is the error that I receive: http://imageshack.us/a/img203/7858/ht1f.png
This is MyDocuments folder: http://imageshack.us/a/img802/8558/mim5.png
Access MyDocuments folder is denied
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Jun 28, 2013, 6:07 AM EDT
See if you can sort something out from this link:
http://www.blackwasp.co.uk/FolderRecursion.aspx
VulpesRank #55 · 29.2K reputationPosted Jun 28, 2013, 1:46 AM EDT
Dan21 reputationPosted Jun 28, 2013, 4:08 AM EDT
Something like to check their attributes?
EDIT: I ran it as administrator and still doesn't let me access them...