public void GetSubElementByAttribute(string XmlPath, string FatherElement, string AttributeName, string AttributeValue, int ArrayLength)
{
System.Collections.ArrayList al = new System.Collections.ArrayList();
XmlDocument docXml = new XmlDocument();
docXml.Load(@XmlPath);
XmlNode xn=xmlDoc.SelectSingleNode("root");
XmlNodeList xnl=xn.ChildNodes;
foreach(XmlNode xnf in xnl)
{
XmlElement xe=(XmlElement)xnf;
XmlNodeList xnf1=xe.ChildNodes;
foreach(XmlNode xn2 in xnf1)
{
Console.WriteLine(xn2.InnerText);
}
}
}
{
System.Collections.ArrayList al = new System.Collections.ArrayList();
XmlDocument docXml = new XmlDocument();
docXml.Load(@XmlPath);
XmlNode xn=xmlDoc.SelectSingleNode("root");
XmlNodeList xnl=xn.ChildNodes;
foreach(XmlNode xnf in xnl)
{
XmlElement xe=(XmlElement)xnf;
XmlNodeList xnf1=xe.ChildNodes;
foreach(XmlNode xn2 in xnf1)
{
Console.WriteLine(xn2.InnerText);
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货