Hi
you have to provide the full path for the folder from where you are looking the files.
String[] allfiles = null;
allfiles = System.IO.Directory.GetFiles("C://Users/.NET v2.0", "*.*", System.IO.SearchOption.AllDirectories);
As in users folder there are few folder on which you don't have access, that's why you are getting this error or you can run your VS as administrator.