zoukankan      html  css  js  c++  java
  • 添加 XML内Rows数据

          
            public static void addItemToXml(string method,string firstKey,string id,string checkName,string refValue)
            {
                XmlDocument xDoc = new XmlDocument();
                xDoc.Load(txtValueHelper.txtValue);
                XmlNode xNode = xDoc.SelectSingleNode("Check");
                XmlElement xRoot = xDoc.CreateElement("CheckTable");
                xRoot.SetAttribute("ID", id);
                XmlElement xMethodName = xDoc.CreateElement("MethodName");
                xMethodName.InnerText = method;
                xRoot.AppendChild(xMethodName);
                XmlElement xFirKey = xDoc.CreateElement("MethodArgs");
               xFirKey.InnerText = firstKey;
               xRoot.AppendChild(xFirKey);
               // XmlElement xCheckid = xDoc.CreateElement("Checkid");
               // xCheckid.InnerText = id;
               // xRoot.AppendChild(xCheckid);
                XmlElement xCheckName = xDoc.CreateElement("CheckName");
                xCheckName.InnerText = checkName;
                xRoot.AppendChild(xCheckName);
               // xRoot.AppendChild(xCheckid);
                XmlElement xRefValue = xDoc.CreateElement("RefValue");
                xRefValue.InnerText = refValue;
                xRoot.AppendChild(xRefValue);
                XmlElement xCheckValue = xDoc.CreateElement("CheckValue");
                xCheckValue.InnerText = "1";
                xRoot.AppendChild(xCheckValue);
                xNode.AppendChild(xRoot);
                xDoc.Save(txtValueHelper.txtValue);
                MessageBox.Show("Add Sucess.");
            }
    

      

  • 相关阅读:
    219. Contains Duplicate II
    189. Rotate Array
    169. Majority Element
    122. Best Time to Buy and Sell Stock II
    121. Best Time to Buy and Sell Stock
    119. Pascal's Triangle II
    118. Pascal's Triangle
    88. Merge Sorted Array
    53. Maximum Subarray
    CodeForces 359D Pair of Numbers (暴力)
  • 原文地址:https://www.cnblogs.com/EthanSun/p/3183386.html
Copyright © 2011-2022 走看看