C# UWP框架中不支持XmlDocument.Save(字符串)?
我试着编译代码 但是,它无法被编译。因为“XmlDocument”没有字符串参数函数 UWP框架,不支持XmlDocument.Save(字符串)吗 有人能帮我在UWP框架中使用XmlDocument保存Xml文件吗C# UWP框架中不支持XmlDocument.Save(字符串)?,c#,xml,uwp,C#,Xml,Uwp,我试着编译代码 但是,它无法被编译。因为“XmlDocument”没有字符串参数函数 UWP框架,不支持XmlDocument.Save(字符串)吗 有人能帮我在UWP框架中使用XmlDocument保存Xml文件吗 StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation; string strPath = Path.Combine(
StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
string strPath = Path.Combine(InstallationFolder.Path, "Assets\\MySetting.xml");
XmlDocument xdoc = new XmlDocument();
xdoc.Save(strPath);
你可以看看这里 可以通过GetXml()获取字符串。 您可以通过SaveToFileAsync(IStorageFile)保存到文件 您可以首先通过LoadFromFileAsync(IStorageFile)加载xml文件 或加载XML(字符串) 我希望这有帮助