| XmlTextReader xmlDocument = new XmlTextReader("MyXmlFile.xml"); while (xmlDocument.Read()) Console.WriteLine(IpAdres ); |
*XmlTextReader xmlDocument = new XmlTextReader("TcpServer.xml");
At this sentence you just defined your stream for reading xml and set it’s parameter which is about file path .
*while (xmlDocument.Read()) after defined your stream, you can start reading the first line of your file
*xmlDocument.NodeType == XmlNodeType.Element At this part of code you just verify your node type for sure it not root node. And then you can use switch to take your node name .
* when you found which name you search you could read that line and convert which type you want same this => _IpAdres = Convert.ToString(xmlDocument.ReadString());
0 yorum:
Yorum Gönder