C# .net core XmlDocument 使用Load和Save方法
代码: string path =”C://xxx/file” XmlDocument xmlDoc = new XmlDocument(); #if NET462 xmlDoc.Load(path); #else string content = File.ReadAllText(path); xmlDoc.LoadXml(content.Trim()); #endif …… …… #if NET462 xmlDoc.Save(path); #else FileStream fs = new FileStream(path, FileMode.Create); XmlWriterSettings settings = new … “C# .net core XmlDocument 使用Load和Save方法”
Read More