How to get application settings path in winforms?

一个人想着一个人 提交于 2020-01-06 05:36:14

问题


In Settings.Settings in Winforms I have some User settings, and I must clean up them.

I can't do it by:

Settings.Default.SomeUserSettings = null;

It must be done by hand .

So, where can I find those settings ?

I'm using windows 7.

Or maybe you know some application, from which I can find last edited files?


回答1:


Look in the folder of your application, there is a XML file named yourAppName.exe.config. This is where the user settings are saved.

To get the path you can use :

string path = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;



回答2:


If you intend to do it by hand then In the Application Folder(The folder where the application is installed) or Debug folder(if you are running Visual Studio Solution) you would see the File with Extension of Name.exe.config Open it with notepad or dreamweaver and see the XML there it would be something like

<Mark_V1._0.myAppSett>
  <setting name="validated" serializeAs="Bool">
     <value>False</value>
  </setting>
</Mark_V1._0.myAppSett>

Modify the <value > tag to change the value



来源:https://stackoverflow.com/questions/5291821/how-to-get-application-settings-path-in-winforms

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