Hello, fellows. I have a simple question to you, maybe you can help me. I try to save data in C#. For exemple, i make an application and the user select his options. What type of file should I use to save his options? The next time the application opens, options should be the same as last time. Would someone explain to me how to do this and which type of files should I use?

Recommended Answers

All 3 Replies

My preference is to store options in a settings object (application-specific) and then serialize it to an XML file in either the ProgramData folder or isolated storage.

This accomplishes three big things, in my opinion:

  1. The file is located in a place that isn't under tight security (like the app.config file would be).
  2. The file is human readable.
  3. When deserialized, it's easy to bind settings to the user interface.

hmm, thanks. I will try this. Could I revert with a few questions if I fail?

Certainly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.