0
c# and XMLreader
how to write c# program for reading this xml file <?xml version = "1.0"?> <contact-info> <name>Tanmay Patil</name> <company>TutorialsPoint</company> <phone>(011) 123-4567</phone> </contact-info> using XMLREADER class
2 Respuestas
+ 1
https://www.dotnetperls.com/xmlreader
string NodeName;
// Create an XML reader for this file.
using (XmlReader reader = XmlReader.Create("c:\\Temp\\TestXMLReader.xml"))
{
while (reader.Read())
{
// Only detect start elements.
if (reader.IsStartElement())
{
NodeName = reader.Name;
// Next read will contain text.
if (reader.Read())
{
MessageBox.Show(NodeName + " " + reader.Value.Trim());
}
}
}
}
0
thanks so much
i must study more xml