本帖最后由 lyred 于 2010-09-26 21:25:02 编辑

解决方案 »

  1.   

    Xml.XmlDocument doc= new System.Xml.XmlDocument();  
    doc.Loa("");  
    foreach (XmlNode node in doc.GetElementsByTagName("use"))
    {}
      

  2.   

    doc.Loa("");  这里怎么写?如何遍历文件夹获取文件
      

  3.   

    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
      

  4.   

    string[] files = Directory.GetFiles(@"C:\xmlfiles", "*.xml"); 
    foreach (string file in files)
    {
    //
    }
      

  5.   

                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;
                    }
                }