Does someone know how to save text in textboxes and items in listviews so that the next time I start the application it will remember those specific settings. It wi开发者_StackOverflow社区ll need to save the settings on closure and open the settings on start.
All help is appriciated!
Thank you in advance!
This blog post has an excellent introduction to this area.
You need to create a Settings object. To this you add the properties you wish to persist and then on exit you call
Properties.Settings.Default.Save();
to write them to a user.config
file. On start up you access them via something like this:
string username = Properties.Settings.Default[“Username”];
This MSDN article goes into even more depth.
there are number of options you can choose from:
you can you Configuration class to save your settings in your profile
create Business Object and persist/save it as xml and you can load it back on start up
精彩评论