c# - WPF - Clear parameter's value in application on first running -
i developing application using wpf. after user installed , started application save parameters in application settings on user scope if value of parameters null.
if (properties.settings.default.appkey == string.empty) { properties.settings.default.appkey = "some random key" properties.settings.default.save(); }
the problem is, if user uninstall application install 1 time again values of parameters remain.
is possible known if first time application running clean values , set again?
you utilize other bool property "firsttimeuse" user scoped, default value = true , @ run time check , if true know it's first use. set false , save setting file. next time start app, know had been started before.
if(settings.default.firsttimeuse) { //clean values here settings.default.firsttimeuse = false; settings.default.save(); }
c# .net wpf
No comments:
Post a Comment