I've got the following exception:
SystemUnauthorizedAccess Exception: Access to the path <path> is denied.
with the following code:
foreach (string doc in Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "*.*", SearchOption.AllDirectories).ToList())
{
MessageBox.Show(doc);
}
I need to get all file names in the MyDocuments hierarchy. Suggestions?