109,886
社区成员




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();
}
}
class Program
{
static void Main(string[] args)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(@"c:\1.xml");
XmlNode node = xmldoc.SelectSingleNode("//return");
string str = node.Attributes[0].Value;
Console.ReadKey();
}
}