简体   繁体   English

设置升级后如何删除以前的用户设置?

[英]How to remove previous user settings after settings upgrade?

After doing a: 做完之后:

MyApp.Properties.Settings.Default.Upgrade();

How can I remove any previous setting files? 如何删除以前的设置文件? The problem I'm having is I have a function where the user can reset his/her own data using: 我遇到的问题是我有一个功能,用户可以使用以下方法重置他/她自己的数据:

Properties.Settings.Default.Reset();

However on the next start of the application, since the old user settings are still there it will be upgraded again. 但是,在下一次启动应用程序时,由于旧的用户设置仍然存在,因此将再次升级。

How do you keep user.config settings across different assembly versions in .net? 如何在.net中的不同程序集版本中保留user.config设置?
seems to be what you are looking for. 似乎是你在寻找什么。

So use Upgrade, UpgradeRequired=true or false, and Save : it would be quite long to explain all cases, but it is in fact quite easy to figure out what to do. 因此,使用Upgrade,UpgradeRequired = true或false,并保存:解释所有情况将会很长,但实际上很容易弄清楚要做什么。

Looks like there is no way to do this other than doing it manually yourself. 看起来除了自己动手做之外别无他法。 So after a successful upgrade, you can remove the old version manually using file system methods. 因此,升级成功后,您可以使用文件系统方法手动删除旧版本。

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

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