0

I'm working on a winform application which creates directories and copies files to the user's local machine at runtime. My question is: Can my application create and copy files to the user's local machine even if he doesn't have administrative privileges? If not, how can I do that?
Thanks
EDIT: I'm asking because a user complained that some files weren't copied to his HD.

4

2 回答 2

0

You need elevated permissions only to copy to certain protected areas. This especially caused problems when Vista was introduced because programs used to maintaining data in the folder they were installed (e.g. and ini file) would no longer work with default permission settings.

Have a look at Environment.SpecialFolders

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

especially at the CommonApplicationData location.

It is wise to store your program data in a subfolder from that or a similar location intended for program specific storage.

于 2012-07-31T23:59:38.263 回答
0

You can do anything you said.

But you need to give admin rights to your application.

Also see this and this.

于 2012-08-01T00:00:19.367 回答