獲取XML文檔節點的值

XmlTextReader reader = new XmlTextReader(System.Windows.Forms.Application.StartupPath + "\\ServerProperty.xml");

XmlDocument xml = new XmlDocument();

xml.Load(reader);

value = xml.SelectSingleNode("/ServerProperty/" + tab).InnerText.Trim();

//xml.SelectSingleNode(節點)

原文地址:https://www.cnblogs.com/nofliu/p/1696833.html