日期:2014-05-17 浏览次数:20783 次
class Program { static void Main(string[] args) { string path = Path.GetFullPath("../../Files/Test.xml"); XmlDocument doc = new XmlDocument(); doc.Load(path); XmlNode xn = doc.SelectSingleNode("return"); string attr = xn.Attributes["msgid"].Value; Console.WriteLine(attr); XmlNode xnTwo = doc.SelectSingleNode("return/arguments/integer[@id='result']"); Console.WriteLine(xnTwo.InnerText); Console.Read(); } }