var doc = new XDocument ( new XDeclaration ("1.0", "utf-16", "yes"), new XElement ("test", "data") ); string tempPath = Path.Combine (Path.GetTempPath(), "test.xml"); doc.Save (tempPath); File.ReadAllText (tempPath).Dump(); Building an XML document
本文共 318 字,大约阅读时间需要 1 分钟。
var doc = new XDocument ( new XDeclaration ("1.0", "utf-16", "yes"), new XElement ("test", "data") ); string tempPath = Path.Combine (Path.GetTempPath(), "test.xml"); doc.Save (tempPath); File.ReadAllText (tempPath).Dump(); Building an XML document
转载于:https://www.cnblogs.com/sanic/archive/2012/03/27/2420447.html