XML or INI files for storage?

c#, ini, xml

Solution

In my opinion there are a lot of options, but when not very experienced you should keep it as easy as possible.

One way is to use the Settings you can generate with your project itself.

Just add a settings file to your project by clicking on `Add > New Item` in the Solution Explorer, and choose `Settings File`.

This is a useful article on adding lists to your settings file.

In your case you could also opt for a `string` setting. Just save the integer values to that `string` using:

Properties.Settings.Default.SettingX = string.Join(",", array);

Read them back using this:

string[] list = Properties.Settings.Default.SettingX.Split(',');

Problem

What is the best way for storing a list of values for using in my program, and enable the user to change them? XML file or INI file and why? If you have a better suggestion, you are welcome. EDIT: For getting the most appropriate answer, here are some details. However, the answers can help other users as the custom details are written as comments only. I have a collection of elements, each is marked with "true" or "false" value. In my program I would like to use only the elements which are signed with "true" value in the list. I can use an Enum with the "True" elements only, but I would like the user to choose his desired elements, by changing false to true and vice versa. However, I do not want him to select the desired elements in every execution. Thats why I think about using a file that could be handy changed according to user preferance.

Original source

Related problems