L
Lang Murphy
I'm baaaaack... some of you answered a question I had last week. Only
problem is: I'm a dope who doesn't understand most of what y'all posted. Raw
noob when it comes to .Net and C#.
So I'm going to be more specific... All I need to do at the moment is figure
out how to replace our usage of .ini files as configuration files for our
small, utility type apps. I'm not looking to use XML as a data stream or
anything like that. Not right now, anyway...
So... let's say I've got this ini file:
[OS]
OS1 = "Windows 2000"
OS2 = "Windows XP"
OS3 = "Windows Vista"
[RAM]
RAM1 = "256MB"
RAM2 = "512MB"
RAM3 = "1GB"
[Model]
Mod1 = "D620"
Mod2 = ""
Mod3 = ""
Which I -think- translates to something like this in XML:
<?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <section name="OS">
<setting name="OS1" value=""Windows 2000"" />
<setting name="OS2" value=""Windows XP"" />
<setting name="OS3" value=""Windows Vista"" />
</section>
- <section name="RAM">
<setting name="RAM1" value=""256MB"" />
<setting name="RAM2" value=""512MB"" />
<setting name="RAM3" value=""1GB"" />
</section>
- <section name="Model">
<setting name="Mod1" value=""D620"" />
<setting name="Mod2" value="""" />
<setting name="Mod3" value="""" />
</section>
</configuration>
All I want to know is: 1. How to read, say, OS2 out of the OS section. 2.
How to insert a RAM4 setting name with the value of "2GB" 3. How to modify
the value of Mod2. I suppose all that goes out the window if the structure
of the XML file in incorrect...
At any rate, all responses greatly appreciated in advance!
Thanks,
Lang
problem is: I'm a dope who doesn't understand most of what y'all posted. Raw
noob when it comes to .Net and C#.
So I'm going to be more specific... All I need to do at the moment is figure
out how to replace our usage of .ini files as configuration files for our
small, utility type apps. I'm not looking to use XML as a data stream or
anything like that. Not right now, anyway...
So... let's say I've got this ini file:
[OS]
OS1 = "Windows 2000"
OS2 = "Windows XP"
OS3 = "Windows Vista"
[RAM]
RAM1 = "256MB"
RAM2 = "512MB"
RAM3 = "1GB"
[Model]
Mod1 = "D620"
Mod2 = ""
Mod3 = ""
Which I -think- translates to something like this in XML:
<?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <section name="OS">
<setting name="OS1" value=""Windows 2000"" />
<setting name="OS2" value=""Windows XP"" />
<setting name="OS3" value=""Windows Vista"" />
</section>
- <section name="RAM">
<setting name="RAM1" value=""256MB"" />
<setting name="RAM2" value=""512MB"" />
<setting name="RAM3" value=""1GB"" />
</section>
- <section name="Model">
<setting name="Mod1" value=""D620"" />
<setting name="Mod2" value="""" />
<setting name="Mod3" value="""" />
</section>
</configuration>
All I want to know is: 1. How to read, say, OS2 out of the OS section. 2.
How to insert a RAM4 setting name with the value of "2GB" 3. How to modify
the value of Mod2. I suppose all that goes out the window if the structure
of the XML file in incorrect...
At any rate, all responses greatly appreciated in advance!
Thanks,
Lang