如何使Settings.settings数据持久化

发布于 12-15 14:03 字数 134 浏览 3 评论 0原文

我有一个 Windows 窗体应用程序,我使用 Settings.settings 类来存储用户的配置(电子邮件首选项、主题等),我没有意识到用户关闭应用程序后,设置就消失了!

这个应用程序即将发布到生产环境,所以我必须尽快提供解决方案。

I have a Windows Forms application and I'm using the Settings.settings class to store user's configuration (email preferences, theme, etc) I didn't realize that after the user closes the app, the settings are gone!!

This app is about to be released to production, so I have to provide a solution ASAP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热情消退2024-12-22 14:03:12

设置后您必须保存它们。你有没有尝试过:

Properties.Settings.Default.Save();

You do have to save them after you set them. Have you tried:

Properties.Settings.Default.Save();
很酷不放纵2024-12-22 14:03:12

你这样使用它们吗?

... changes ...
Properties.Settings.Default.Save();

Are you using them like this?

... changes ...
Properties.Settings.Default.Save();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文