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.");
            }
    

      

  • 相关阅读:
    单例模式 & Init(allocWithZone:)
    Go 初体验
    Go 初体验
    beego 初体验
    beego 初体验
    beego 初体验
    beego 初体验
    beego 初体验
    beego 初体验
    beego 初体验
  • 原文地址:https://www.cnblogs.com/EthanSun/p/3183386.html
Copyright © 2011-2022 走看看