I need to persist a list of object between application launches per user basis; how can I do it?
The object is simple: 4 strings and one int.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Description
One way is to use
BinaryFormatterto save a list of serializable objects to a binary file. You can use theSoapFormatterif you want a readable / editable file.Sample
Here a class that makes it possible to save a list of serializable objects.
More Information:
Update
You said in a comment that you try to save application settings. Consider using Application Settings.
MSDN: Using Settings in C#