PDA

View Full Version : reading XML IN C#


keylen
12-18-03, 07:59 AM
I want to read this xml

Thanks guys,

<?xml version="1.0" encoding="utf-8">
<configuration><appSettings><add key="port" value="9000" />
<add key="name" value="Uno" /><add key="database" value="win2003" />
<add key="DatabaseUser" value="root" />
<add key="DatabasePassword" value="screenmax" />
<add key="spots" value="D:\Screenmax (Keylen)\ScrenmaxPlayer\bin\Debug\Spot Folder" />
<add key="playlist" value="D:\Screenma(Keylen\ScrenmaxPlayer\bin\Debug\Data" />
</appSettings></configuration>

Alexei Kubarev
07-05-04, 12:57 PM
Well... its quite easy actually...
All you need to do is use a System.XML namespace and use XMLReader to read from an XML file... it takes only 5-6 lines of code to make it work :D

igor.kudela
02-16-05, 05:29 AM
well this seems to be a configuration file so no need to use System.XML just use System.Configuration and read the individual keys by calling them