public static XmlNodeList getConfigChildNodes(string xmlPath, string nodePath)
{
nodePath = nodePath.Replace("\\", "/").Trim('/');
XmlDocument doc = new XmlDocument();
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;//忽略注释
XmlReader reader = XmlReader.Create(xmlPath, settings);
doc.Load(reader);
//找出名称为“add”的所有元素
XmlNode nodes = doc.SelectSingleNode(nodePath);
XmlNodeList xln = nodes.ChildNodes;
return xln;
}
{
nodePath = nodePath.Replace("\\", "/").Trim('/');
XmlDocument doc = new XmlDocument();
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;//忽略注释
XmlReader reader = XmlReader.Create(xmlPath, settings);
doc.Load(reader);
//找出名称为“add”的所有元素
XmlNode nodes = doc.SelectSingleNode(nodePath);
XmlNodeList xln = nodes.ChildNodes;
return xln;
}