查找Version节点
代码语言:javascript复制static void Main(string[] args)
{
XmlTextReader tReader = new XmlTextReader("..\..\StudentList.xml");
string info = string.Empty;
while (tReader.Read())
{
if (tReader.Name == "Version")
{
info = "版本:" tReader.GetAttribute("vNo");
break;
}
}
Console.WriteLine(info);
}