我试图编译该代码,
但是,它无法编译。因为'XmlDocument'没有字符串参数功能。
UWP Framework,它不支持XmlDocument.Save(string)??
谁能帮助我在UWP框架中使用XmlDocument保存Xml文件?
StorageFolder InstallationFolder = Windows.ApplicationModel.Package.Current.InstalledLocation;
string strPath = Path.Combine(InstallationFolder.Path, "Assets\\MySetting.xml");
XmlDocument xdoc = new XmlDocument();
xdoc.Save(strPath);
你可以看看这里。 https://docs.microsoft.com/en-us/uwp/api/Windows.Data.Xml.Dom.XmlDocument
您可以通过GetXml()获取字符串。您可以通过SaveToFileAsync(IStorageFile)保存到文件您可以先通过LoadFromFileAsync(IStorageFile)或LoadXml(String)加载xml文件
我希望有所帮助