日期:2014-05-18 浏览次数:21041 次
XmlDocument xml = new XmlDocument();
string xmlpath = path; // path是XML的文件路径
xml.Load(xmlpath);
XmlNode xn = xml.DocumentElement.SelectSingleNode("note") ;//note是查找的节点
XmlNodeList nodes = xn.SelectNodes("note");
foreach (XmlNodeList no in nodes) //读取每一个note {
XmlElement xe=(XmlElement)no;
XmlNodeList nodes1=xe.ChildNodes
foreach(XmlNode no1 in nodes1) //读取note中的所有属性
{
XmlElement xe2=(XmlElement)no1;
string aaa = xe2.GetAttributeNode("attribute").ToString();//取属性]
写数据库.这个你肯定会
}
}