简体   繁体   English

如何使Settings.settings数据持久化

[英]How to make Settings.settings data persistent

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!! 我有一个Windows窗体应用程序,我正在使用Settings.settings类来存储用户的配置(电子邮件首选项,主题等)我没有意识到在用户关闭应用程序后,设置已经消失!

This app is about to be released to production, so I have to provide a solution ASAP. 这个应用程序即将发布到生产中,所以我必须尽快提供解决方案。

You do have to save them after you set them. 您必须在设置它们后保存它们。 Have you tried: 你有没有尝试过:

Properties.Settings.Default.Save();

Are you using them like this? 你是这样用的吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM