应用程序运行后,设置在哪里保存? [英] Where do settings get saved once the application is running?

查看:94
本文介绍了应用程序运行后,设置在哪里保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我想知道在我的应用程序运行时(用Windows窗体制作 - 在我发布我的应用程序后,而不是在我调试它时)保存设置的位置(在什么文件中) 。保存我的所有设置,范围为用户。并且默认值为0.

例如我得到了这段代码

Hello
I would like to find out where (in what file) do settings get saved when my application runs (made with windows forms - after i publish my application, not when i debug it). All my settings are saved with the Scope being "User" and the default value being 0.
For example i got this code

展开 | 选择 | Wrap | 行号

推荐答案

您只需将其写入文本文件即可。

有关更多高级选项,请将其保存到嵌入数据库中,例如SQLite。
You can simply write it into a text file.
For more advance options, save it into embed database, such as SQLite.


是的我想到了(关于txt文件),但我希望我能在xml文件中找到它们(因为应用程序在关闭并重新打开后知道保存的设置)
Yes that did cross my mind (about the txt file) but i was hoping i can find them somewhere in an xml file (since the application knows the saved settings after closing and reopening it)


他'在谈论bui在设置类中。


这是设置的MSDN页面。请查看标题为更改应用程序会话之间的设置值的部分

http://msdn.microsoft.com/en-us/libr ... tingscs_topic3


应该有一个文件(可能是你的可执行文件夹),其名称如下所示:< AssemblyName> .exe.config
He''s talking about the built in settings class.

Here''s the MSDN page for Settings. Take a look at the section entitled, "Changing the Value of a Setting Between Application Sessions"

http://msdn.microsoft.com/en-us/libr...tingscs_topic3

There should be a file somewhere (probably your executable folder) with a name that looks like: <AssemblyName>.exe.config


这篇关于应用程序运行后,设置在哪里保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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