XmlDocument doc = new XmlDocument();
            XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
            doc.AppendChild(dec);
            //创建一个根节点(一级)
            XmlElement root = doc.CreateElement("First");
            doc.AppendChild(root);

 

//xml文件包含中文字符,且没有说明xml编码格式时.就无法被xmlDocument对象和IE识别。

   解决方式,在xml文件中添加encoding说明  <?xml version=“1.0” encoding="GBK"?>  即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-08-25
  • 2021-08-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-11-07
  • 2021-09-29
  • 2021-08-19
相关资源
相似解决方案