//生成XML
            XmlDocument xmlDoc = new XmlDocument();
            XmlElement root = xmlDoc.CreateElement("Data");
            xmlDoc.AppendChild(root);
            foreach (var item in agentStateDic)
            {
                XmlElement element = xmlDoc.CreateElement("Agent");
                element.SetAttribute("Code", item.Key);
                element.SetAttribute("Status", item.Value);
                root.AppendChild(element);
            }
            rtn = xmlDoc.InnerXml;

  

Code:

 

相关文章:

  • 2021-11-13
  • 2021-10-30
  • 2022-02-21
  • 2021-10-02
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-01
  • 2021-05-29
  • 2021-11-24
  • 2021-11-25
  • 2021-08-14
相关资源
相似解决方案