I’m trying to do an auto-backup program that takes a folder and copies it into another folder. Pretty easy task :
File.Copy(Source, Destination);
Source is something like C:\Users\SomeUser\MyDocuments\SavedFiles
Destination is something like D:\BackUp
But when I run my program , I get “Error with access to the path C:\blabla..... access is denied.
Is there any type of permission I must change to use the Copy method ? I guess so.. I looked a little but I can’t find where to change such a thing.
Any Idea ?
UPDATE

You have to assume that you might not have permission to access some files and folders on your hard drive.
One solution is to manually run your application with administrator-level permissions, but it is easier to modify the manifest file so that the application automatically seeks admin level when it is run.
You can do this by adding a mainifest file to your project (Add new item…).
Then change the line
to
Obviously, this might not solve your problem if the user who is meant to run the program does not have an administrator-level account.