using System;
using System.Text;
using System.Xml;
namespace ReadXml
{
class Program
{
static void Main(string[] args)
{
XmlReader xmlReader = XmlReader.Create("xml file location");
while(xmlReader.Read())
{
if((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "Cube"))
{
if(xmlReader.HasAttributes)
Console.WriteLine(xmlReader.GetAttribute("currency") + ": " + xmlReader.GetAttribute("rate"));
}
}
Console.ReadKey();
}
}
}
using System.Text;
using System.Xml;
namespace ReadXml
{
class Program
{
static void Main(string[] args)
{
XmlReader xmlReader = XmlReader.Create("xml file location");
while(xmlReader.Read())
{
if((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "Cube"))
{
if(xmlReader.HasAttributes)
Console.WriteLine(xmlReader.GetAttribute("currency") + ": " + xmlReader.GetAttribute("rate"));
}
}
Console.ReadKey();
}
}
}
No comments:
Post a Comment