zoukankan      html  css  js  c++  java
  • xml数据改动

         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);
  • 相关阅读:
    term "JavaScript"
    Pro Git
    Pro Git
    Pro Git
    git
    flask
    OJ
    [蓝桥杯]Huffuman树
    priority_queue优先队列
    [蓝桥杯]高精度加法
  • 原文地址:https://www.cnblogs.com/gaitian00/p/3935513.html
Copyright © 2011-2022 走看看