C# Dom方式读取 xml

来源:互联网 发布:qq回收站清空数据恢复 编辑:程序博客网 时间:2024/05/21 05:59
private void AnalyzeXml(FileInfo xmlFile, ref Dictionary<string, string> dicXmlContents)            {                XmlDocument xmlDoc = new XmlDocument();                xmlDoc.Load(xmlFile.FullName);                XmlNode root = xmlDoc.DocumentElement;                XmlNodeList xmlSql = root.SelectNodes("sql");                foreach (XmlNode item in xmlSql)                {                    dicXmlContents.Add(item.Attributes["name"].Value, item.FirstChild.Value);                }                            }

原创粉丝点击