首页 > 其他 > 详细

xml数据改动

时间:2014-08-25 18:54:54      阅读:362      评论:0      收藏:0      [点我收藏+]
     public void  reXml ( string namepngname  )
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(_xmlpath);
           /*XmlNodeList  lis =   doc.GetElementsByTagName("string");
            foreach ( XmlNode  u in lis)
            {
                //Debug.WriteLine(u.InnerText.ToString());
                if (u.InnerText.ToLower().Length > 6)
                {
                    if ((u.InnerText.ToLower()).Substring(0, 5) == "output")
                    {
                        u.InnerText = namepngname;
                    }
                }

            }
            Debug.WriteLine(doc.OuterXml);
            */
            XmlNode root = doc.DocumentElement;
          
            XmlNodeList  cbo = root["dict"].LastChild.ChildNodes;
            foreach ( XmlNode cc in cbo )
            {
                if (cc.InnerText.ToLower().Length >6)
                {
                    if ((cc.InnerText.ToLower()).Substring(0, 6) == "output")
                    {
                       // Debug.WriteLine(cc.InnerText);
                        cc.InnerText = namepngname;
                    }
                    //Debug.WriteLine(cc.InnerText.ToLower().Substring(0, 5));
                }

                //Debug.WriteLine(cc.InnerText);
            }

            doc.Save(_xmlpath);

 

xml数据改动

原文:http://www.cnblogs.com/gaitian00/p/3935513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!