[回答]不允许将XAP中包含的文件保存到隔离存储中吗? [英] [ANSWERED] Saving file included in XAP to Isolated Storage not allowed?

查看:92
本文介绍了[回答]不允许将XAP中包含的文件保存到隔离存储中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我试图将应用程序中包含的png文件复制到隔离存储",以在实时磁贴上使用.当我将XAP部署到手机上时,这工作得很好,但是,当我将它作为Beta上传到商店时,它会抛出UnauthorizedAccessException 用这种方法.

In my app I'm trying to copy png files that are included in my app to Isolated Storage, to use on the live tile. This works perfectly fine when I deploy the XAP to my phone, however, when I upload it to the store as a beta, it throws an UnauthorizedAccessException in this method.

代码如下:

IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
FileStream largeTile = new FileStrea,("Tile/LargeTile.png", FileMode.Open);
FileStream defaultTile = new FileStream("Tile/Tile.png", FileMode.Open);
IsolatedStorageFileStream defaultIsoStream = new IsolatedStorageFileStream(TileFolder + "default.png", FileMode.Create, myStore);
IsolatedStorageFileStream largeIsoStream = new IsolatedStorageFileStream(TileFolder + "default2.png", FileMode.Create, myStore);
largeTile.CopyTo(largeIsoStream);
defaultTile.CopyTo(defaultIsoStream);
largeIsoStream.Close(); 
defaultIsoStream.Close(); 
largeTile.Close(); 
defaultTile.Close();
largeIsoStream.Dispose(); 
defaultIsoStream.Dispose(); 
largeTile.Dispose(); 
defaultTile.Dispose();
myStore.Dispose();



Ryken Productions



Ryken Productions

推荐答案

IsolatedStorageFileStream defaultIsoStream = new IsolatedStorageFileStream(TileFolder + "default.png", FileMode


在这一行中 TileFolder 是指代码中的哪个位置?


In this line TileFolder refers to which location in your code please?


这篇关于[回答]不允许将XAP中包含的文件保存到隔离存储中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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