0

Basically I have a dictionary that updates every time someone sends a message. It stores a value that is used for something else, but every time I close the application, the dictionary value resets.

Is it possible to save the value that the dictionary has when the application closes and use it the next time the application is run?

Cear
  • 21
  • 3
  • Possible duplicate: http://stackoverflow.com/questions/495647/serialize-class-containing-dictionary-member – Abion47 Oct 26 '16 at 01:47
  • Use database, considering your data is huge. – Lei Yang Oct 26 '16 at 01:47
  • You could persist the values in a database or on the filesystem. Youd have to write some application startup code to check for data, then load it into the dictionary – applejacks01 Oct 26 '16 at 01:48
  • There are many questions on SO discussing various possible approaches - starting from generic http://stackoverflow.com/questions/453161/best-practice-to-save-application-settings-in-a-windows-forms-application and down to very specific cases. You may want to [edit] the post to add results of your research like https://www.bing.com/search?q=c%23%20save%20the%20value%20that%20the%20dictionary%20has%20when%20the%20application%20closes to make it more concrete (way too broad now). – Alexei Levenkov Oct 26 '16 at 01:52

0 Answers0