teixeira Posted July 14, 2006 Posted July 14, 2006 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 Quote
Cags Posted July 14, 2006 Posted July 14, 2006 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. Quote Anybody looking for a graduate programmer (Midlands, England)?
teixeira Posted July 17, 2006 Author Posted July 17, 2006 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 Quote
Administrators PlausiblyDamp Posted July 18, 2006 Administrators Posted July 18, 2006 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.