1

I made a C# program for myself in which I can select and add different things I have to do the next day (a simple schedule).

I have it all sorted out but one thing that I do not know how to begin scripting it. I want to be able to keep the schedule after exit. For example: Tomorrow I have to do the following : (my To-Do list ) etc. . Now I close the program ,and if I re-open it it is all gone.

My question is, how do I keep it after exit?

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
Maiels
  • 41
  • 6
  • 1
    you need a database for that. flatfile or sqlite or mysql etc you could also serialize your list to a file and deserialize it when you open your app. – gimpycpu Dec 28 '14 at 09:44
  • possible duplicate of http://stackoverflow.com/q/3032492/3970411 – Hamid Pourjam Dec 28 '14 at 09:49
  • @gimpycpu I already have a button which exports the whole schedule in a `.txt` filetype. I did it just for testing and also keeping backups. Can I use that export file as a "Import"? Also can I add all this under a `_Mouseclick`? Thank you! – Maiels Dec 28 '14 at 09:49
  • @dotctor sorry if it is a duplicate. I searched in the website as " Keep data" and i suppose i did not see the "Save settings " link – Maiels Dec 28 '14 at 09:52
  • The application settings are different from stored data. I wouldn't use the app settings if I was you. – Patrick Hofman Dec 28 '14 at 09:53
  • @PatrickHofman So how do you recommend I should proceed ? – Maiels Dec 28 '14 at 09:55
  • @Maiels: See the options in my answer. – Patrick Hofman Dec 28 '14 at 09:56
  • On where you might like to save your files: http://stackoverflow.com/questions/9808999/save-data-in-users-name-roaming-appdata – Nathan Cooper Dec 28 '14 at 12:50

1 Answers1

4

Use one of the following options:

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325