取多个XML内结点的一个值,输出EXCEL 今晚结贴 本帖最后由 lyred 于 2010-09-26 21:25:02 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Xml.XmlDocument doc= new System.Xml.XmlDocument(); doc.Loa(""); foreach (XmlNode node in doc.GetElementsByTagName("use")){} doc.Loa(""); 这里怎么写?如何遍历文件夹获取文件 public static string GetXmlValue(string xmlContent, string xmlKey) { string xmlValue = ""; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlContent); XmlNode xnode = xmlDoc.DocumentElement; foreach (XmlNode node in xnode.ChildNodes) { if (node.Attributes[0].Value == xmlKey) { xmlValue = node.InnerText; } } return xmlValue; }http://blog.csdn.net/jn1705/archive/2009/09/10/4535539.aspx string[] files = Directory.GetFiles(@"C:\xmlfiles", "*.xml"); foreach (string file in files){//} string[] files = Directory.GetFiles(@"C:\xmlfiles", "*.xml"); foreach (string file in files) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(file); XmlNodeList nodes = xmlDoc.SelectNodes("//use/value"); foreach (XmlNode node in nodes) { string str = node.InnerText; } } 上传图片判断 紧急求救!数据查询问题 高效 字符串截取 方法 asp.net 怎么才能在设计界面任意地方摆放控件 百分求VSTO动态导出EXCEL例子 有关ASP.NEt的Timer 的问题 在线等 ,谢谢 请问各位大虾,asp.net 编译问题 光标定位问题..(如何用编代码来控制光标定位到某个文本框内?) 实在没辙了,思归大哥请进,各位高手请进 请教:为什么在子目录下不能用authentication配置属性呢?谢谢!!! 刷新页面 重复提交 怎么判断treeview选定的是哪一层节点?
doc.Loa("");
foreach (XmlNode node in doc.GetElementsByTagName("use"))
{}
{
string xmlValue = "";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlContent);
XmlNode xnode = xmlDoc.DocumentElement;
foreach (XmlNode node in xnode.ChildNodes)
{
if (node.Attributes[0].Value == xmlKey)
{
xmlValue = node.InnerText;
}
}
return xmlValue;
}http://blog.csdn.net/jn1705/archive/2009/09/10/4535539.aspx
foreach (string file in files)
{
//
}
foreach (string file in files)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(file);
XmlNodeList nodes = xmlDoc.SelectNodes("//use/value"); foreach (XmlNode node in nodes)
{
string str = node.InnerText;
}
}