Setting Files, Resources files, xml files which is the best to read/write values

teixeira

Regular
Joined
Apr 5, 2005
Messages
94
Location
LEIRIA-PORTUGAL
Hi,

Please someone help me about Resources, Settings and XML.
The point is how should I read/write a configuration file quickly and easily?
I currrently used, DataSet.ReadXml(<path>) and i get/set the values i need, but this is not very heavy and memory consumer?
Settings files, are great, easy to use by name, etc... but i'm having serious problems in writting values there, i load my form, i read the values and when i close it, i wannted to save the current values to settings file, but the values aren't assumed correctly.
I saw a lot of examples using XMLReader and iterate through the nodes to get/set the values.

I hope someone can help me about good programming in read/write configuration files, for my exe, or for my dlls.

Thanks in advance,
Tiago Teixeira
 
The way I generally do it is as you say with the XmlTextReader and the XmlTextWriter classes. Another way of doing it is to create a Settings class and to serialize it using xml serialization.
 
Thanks.
I can perfectly read/write values by someways, but i would like to have an opinion of other to see wich is the most common way.

Regards
Tiago Teixeira
 
Personally I favour the ease of the XMLSerializer class for something like this as it does remove a lot of the complexities.

If you are using 2005 then it takes care of this for you anyway.
 
Back
Top