Hi folks, this i probably rather simple, but i just cant to figure out how to make it work :/
i have this, tiny tiny piece of code, which im actually rather proud of :b
I thought it was clever atleast....
To sum it up, i created that little search thingie to find all folders, and subfolders on the C: drive. But everytime i tried to run, it threw an exception, saying that i did not have acces to System Volume Information. I read up on what the heck it was, and turned out not even administrators have acces to this folder. Oh well, then i tried to create that catch, and hoped i had solved the problem.
But after the "catch" the program stops running, what i really wanted it to do was to skip inaccesible folders.... any clue on how i could do this ?
Thanks a lot !
Ps. oh yes, i have tried to make this work myself.... for quite a couple of hours....
i have this, tiny tiny piece of code, which im actually rather proud of :b
Code:
try { string[] folders = Directory.GetDirectories(@"C:\\", "*", SearchOption.AllDirectories); } catch (UnauthorizedAccessException) { Console.WriteLine("Skipping folder...."); }
To sum it up, i created that little search thingie to find all folders, and subfolders on the C: drive. But everytime i tried to run, it threw an exception, saying that i did not have acces to System Volume Information. I read up on what the heck it was, and turned out not even administrators have acces to this folder. Oh well, then i tried to create that catch, and hoped i had solved the problem.
But after the "catch" the program stops running, what i really wanted it to do was to skip inaccesible folders.... any clue on how i could do this ?
Thanks a lot !
Ps. oh yes, i have tried to make this work myself.... for quite a couple of hours....
Comment