Question

I'm working on a C# WinForms app and I would like to know how can I make a "save state" button. I've heard about serialization, but I want the form to be restarted every run, but allow the user to reload the saved state.

For example, in games you can save your progress and then when you run the game you can either start a new game, or load the save (in either way, when you run the game you always get to the main menu, whether you want to start a new game or load the saved game), that's what I'm looking for.

I hope I've made myself clear.

Was it helpful?

Solution

you have to use the Isolated Storage in .NET to store application data clickhere

OTHER TIPS

Many ways to do it however depending on the size and security specification of the information which needs to be loaded you could take different approaches.

One approach is surly what Dhaval Patel mentioned earlier [Isolated Storage in .NET]. If this information of yours is part of a wizard or something similar I would personally store them in a database table. This way your data will be quite accessible[Query-able] and you could enforce your security constraint much easier and you will have lots of room for maneuver in terms of future improvements. Another advice[Only my personal opinion] : Don't pollute your config file with those settings in case you had that in your mind.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top