未经授权例外,而在城域应用使用MostRecentlyUsedList [英] Exception of Unauthorized while using MostRecentlyUsedList in metro apps

查看:168
本文介绍了未经授权例外,而在城域应用使用MostRecentlyUsedList的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C#Store应用程序的工作。我使用 StorageApplicationPermissions.MostRecentlyUsedList
加载本地EPUB文件。
得到这些文件作为存储文件后。

I am working with Store apps using C#. I am using StorageApplicationPermissions.MostRecentlyUsedList to load Local Epub files. After getting those file as a Storage file.

string EpubPathToken= Windows.Storage.AccessCache.StorageApplicationPermissions.MostRecentlyUsedList.Add(file);
StorageFile file = await StorageApplicationPermissions.FutureAccessList.GetFileAsync(EpubPathToken);
Extraction(file);



虽然提取EPUB文件邮编用来包文件夹的ApplicationData 我收到的未经授权的 Exeption。

While Extracting the Epub file as Zip to Package folder using ApplicationData I am getting an Exeption of Unauthorized.

这里是错误的屏幕截图

为什么因为如果我使用喜欢的图片库KnownFolders提取工作正常使用相同的代码。

Why because If I use the same code using from KnownFolders like Pictures Library the Extraction is working Fine.

任何一个可以给我这方面有任何想法?

Can any one give me any idea about this ?

推荐答案

最后,我得到解决的未经授权的异常与使用的博客

Finally I solved the issue of getting exception of Unauthorized With the use of Blog

我按照我的要求改变的代码片段。

I changed the code snippet according to my requirement.

代码的来源描述 ZipArchiveEntry 写入文件的字节,
所以我用了一个辅助方法 GetByteFromFile(),这需要 StorageFile 对象,并返回我的字节[] 阵列。

The source of code describes writes bytes of file in ZipArchiveEntry, hence I used a helper method GetByteFromFile(), which takes StorageFile object and returns me byte[] array.

最后感谢 Xyroid

这篇关于未经授权例外,而在城域应用使用MostRecentlyUsedList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆