开发者

Store a variable locally

Is there a way i can store a number locally?

I want to make a counter, so each time the user clicks the button the number is increased. But i would like it to be stored so i could reboot my computer and when its loaded it di开发者_Python百科splays the last number.


I would refer to this website: http://dotnetslackers.com/articles/net/SettingsManagerforWindowsVistaSidebarGadgets.aspx

You can either download and implement that, though it's a bit bulky for your desired functionality. Alternatively, you can download it and see how the SettingsManager.js file creates an .ini file and then later reads from it (which you could then use to make an .ini file holding an integer, which you would read every time you wanted load the value and save every time the value changed).


You could do worse than use the Windows Registry for this.

Some information using C++

Some information using C#

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜