ClickOnce和UserSettings [英] ClickOnce and UserSettings

查看:207
本文介绍了ClickOnce和UserSettings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我有一个ClickOnce应用程序,我正在测试,我问用户第一次使用它们加载该应用程序的几个信息;客户编号和名称。然后我设置属性,以便它们在会话之间保存。该属性是Properties.Settings.Default [客户ID]和类似的名称。



所以我通过控制面板卸载应用程序,并重新安装应用程序,但设置是还在那儿!我去找到我的应用程序的所有目录,并删除设置,但应用程序像它仍然有它们。我甚至可以通过调试器查看它们是否仍然存在。



我如何摆脱它们?这是非常令人沮丧的,因为它几乎不可能测试新的数据和调试任何第一次安装。



谢谢...

解决方案

在回答在重新安装程序时删除设置的一般问题,您还可以添加独特的数据片段,例如可执行文件的日期,校验和或类似的东西。



然后在程序启动时检查保存的数据。如果它们不匹配,则重新安装,您可以删除存储的数据。


Ok, I have a ClickOnce app that I'm testing and I ask the user for a couple of pieces of information the first time they use load the app; Customer Id and Name. I then set the Properties so that they'll be saved across sessions. The property is Properties.Settings.Default["Customer ID"] and similar for name.

So I uninstall the application through control panel and reinstall the application but the settings are still there! I go and find all directories for my application and delete out the settings but the application acts like it still has them. I can even step through the debugger and see that they are still there.

How do I get rid of them all? This is very frustrating since it makes it almost impossible to test new data and to debug any first time installs.

Thanks...

解决方案

In answer to the general problem of removing settings when the program is reinstalled, you could add unique piece of data as well, such as the date of the executable, its checksum, or something similar.

Then check that against the saved data when you program starts. If they don't match, it's a reinstall and you can delete the stored data.

这篇关于ClickOnce和UserSettings的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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