问题描述
以下是一个XML文档<Students><Student><Name>张靓靓</Name><Age>20</Age><Hobby>唱歌歌</Hobby><Addresses><Address>中山路</Address><Address>唐山路</Address><Address>10+1商业大道</Address></Addresses></Student><Student><Name>周杰杰</Name><Age>22</Age><Hobby>耍双节棍棍</Hobby><Addresses><Address>中山路</Address><Address>唐山路</Address><Address>10+1商业大道</Address></Addresses></Student></Students>
解决方案
解决方案二:
mark回去再看
解决方案三:
this.ofdMain.ShowDialog();//选择文件XmlDocumentxml=newXmlDocument();xml.Load(**.xml);//获取第一个节点XmlNodeStudent=xml.DocumentElemnet;foreach(XmlNodenodeinstudent.ChildNodes){TreeNodestudentNode;studentNode=tvXml.Nodes.Add(node.Name);foreach(XmlNodesubNodeinnode.ChildNodes){studentNode.Nodes.Add(subNode.InnerText);}}
时间: 2024-11-29 03:44:26