Makinde A. Israel

Makinde A. Israel

  • 1.6k
  • 168
  • 20.9k

How to Read and Write a Collection to file

Mar 28 2016 2:30 AM
Good day,
please am writing a program that will keep track of events. Though I don't know how best I should have done it. I started off by writing an MyEvent class with public properties like Name of the event, place, time and Date and I wish to extend the class with more public properties as need be. Then I have a SortedDictionary<DateTime, MyEvent> collection where both past, present and future events are collected. My question is how can I write the content of this dictionary to file when closing this app and read that same content into this dictionary again at start-up?
This application will be a desktop app, and I don't want to go the way of SQL because I don't know it and thirdly I want that file to have custom extension and can only be opened with this app.
Thanks in anticipation for your response.

Answers (1)