【发布时间】:2015-05-20 22:48:04
【问题描述】:
我在 InstalledLocation 中有一个文件。我想在这个文件中写一些文本。当我从 Visual Studio 运行时,我的设备没有问题,我可以写入或读取文件。但是当我从商店安装应用程序时,我不能写。它发生一个错误,说“访问被拒绝。 (来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED))'。
我检查了 Package.appxmanifest 中的功能部分,但我没有看到类似“写、读权限”之类的东西。
请看下面的代码。
StorageFile htmlFile = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("mobile.html");
await FileIO.WriteTextAsync(htmlFile, form.MobileHtml); // I am receiving error here.
【问题讨论】: