Exception of Unauthorized while using MostRecently

2019-03-06 02:51发布

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);

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

Here's screen shot of error

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 ?

1条回答
Fickle 薄情
2楼-- · 2019-03-06 03:32

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

I changed the code snippet according to my requirement.

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.

Finally thanks to Xyroid

查看更多
登录 后发表回答