XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlText); //plu.xml 编码是ANSI的。否则称上品名是乱码 XmlElement xeRoot = xmlDoc.DocumentElement; XmlDeclaration xdl = xmlDoc.CreateXmlDeclaration("1.0", "gb2312", "yes"); xmlDoc.InsertBefore(xdl, xeRoot); xmlDoc.Save(fileFullName);
时间: 2024-10-14 00:24:30