如何在winforms中获取应用程序设置路径? [英] How to get application settings path in winforms?

查看:29
本文介绍了如何在winforms中获取应用程序设置路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Winforms 的 Settings.Settings 中,我有一些用户设置,我必须清理它们.

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

我不能这样做:

Settings.Default.SomeUserSettings = null;

必须手工完成.

那么,我在哪里可以找到这些设置?

So, where can I find those settings ?

我使用的是 Windows 7.

I'm using windows 7.

或者您知道某个应用程序,我可以从中找到上次编辑的文件?

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

推荐答案

在你的应用程序文件夹中,有一个名为 yourAppName.exe.config 的 XML 文件.这是保存用户设置的位置.

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;

这篇关于如何在winforms中获取应用程序设置路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆