Click here to Skip to main content
14,732,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have a gap between phase in a project and would like to know something about xml vs. ini 'debate' I have always used ini files coming from VB6 (get it done yesterday) it seem the quickest way open a text file into rich text box and go string hunting with InStr(). So far I have not yet had to do a major app in .NET with other programmers the only bit of a C# app I did the above but used .subString and the other guy I was working with raised no objections. So what is the advantage of XML, the only issue I saw was if a space creeped in the subString would throw a fit.


If you do it properly (via Setting.settings in your project, under properties in the Solution Explorer) then you can use readable code, such as
string imagePath = Properties.Settings.Default.imagePath;
Properties.Settings.Default.imagePath = @"D:\Temp\MyImage.jpg";
With each setting kept separate from each other. The framework then deals with the actual settings file, storing data in XML, instead of you having to make sure it is in teh right place, etc., etc.
NeptuneHACK! 7-Feb-12 5:58am
my 5
glennPattonContracting2 7-Feb-12 6:06am
Okay, right click project in solution explorer, is there a fuller description somewhere, I am aware of Read/Write XML files, Config files, INI files, or the Registry by Alvaro Mendez and Convert INI file to XML by Loki.
One advantage of XML files over INI ones is the tree structure. As you know INI files have {key, value} pairs inside sections. XML files, on the other hand have an 'arbitrary deep' tree hierarchical structure (like for instance, the 'vituperated' Windows registry).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900