.Net application settings path

一世执手 提交于 2019-12-06 01:42:16

问题


By default in windows application setting are saved in this directory:

%USERPROFILE%\Local Settings\Application Data\<Company Name>\<appdomainname>_<eid>_<hash>\<version>\user.config

Is it possible to change path for saving user.config file? For example save it in local folder?


回答1:


You can, if you make your own ApplicationSettingsBase derived class to manage the application settings.

For details, see Application Settings Architecture.

That being said, I strongly recommend not doing this. Using a local folder (local to your app) will require your application to run under elevated permissions on Vista and Windows 7, which is an unnecessary annoyance. User settings files should be configurable via your application, and not something the user ever needs to see or hand-edit...



来源:https://stackoverflow.com/questions/2488277/net-application-settings-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!