UWP Framework不支持XmlDocument.Save(string)?

问题描述 投票:0回答:1

我试图编译该代码,

但是,它无法编译。因为'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);
c# xml uwp
1个回答
1
投票

你可以看看这里。 https://docs.microsoft.com/en-us/uwp/api/Windows.Data.Xml.Dom.XmlDocument

您可以通过GetXml()获取字符串。您可以通过SaveToFileAsync(IStorageFile)保存到文件您可以先通过LoadFromFileAsync(IStorageFile)或LoadXml(String)加载xml文件

我希望有所帮助

© www.soinside.com 2019 - 2024. All rights reserved.