[RESOLVED][2005] need help upon reading my xml file
Elow everyone have a nice day...Could anyone of you help me how to read my xml and put it into a string. Below is my xmlfile and I want to call it to my code.
Code:
<?xml version="1.0" standalone="yes"?>
<Server>
<name>CARCAR</name>
</Server>
I want it to read it and put it into a string inside my code so that i can call it anytime. Could anyone help me this things? Thanks in advance guys.
Re: [2005] need help upon reading my xml file
vb.net Code:
Dim reader As XmlReader = XmlReader.Create("file path here")
reader.Read()
reader.ReadStartElement("Server")
reader.ReadStartElement("name")
MessageBox.Show(reader.ReadString())
reader.ReadEndElement()
reader.ReadEndElement()
reader.Close()
I suggest you read a bit about the XmlReader class. If you want to edit XML documents then you should read about the XmlDocument class too, and the XmlWriter class for good measure.
Re: [2005] need help upon reading my xml file
tnx...jmcilhinney...i will try also to read all about xml at msdn..a million thanks to you jm..God Bless and have a nice day!