【问题标题】:How to get path of a file which is in IsolatedStorage?如何获取IsolatedStorage中文件的路径?
【发布时间】:2013-09-12 06:40:06
【问题描述】:

我想将存储在IsolatedStorage 中的图像设置为磁贴的背景图像。

我们以这种方式创建图块:

StandardTileData tile = new StandardTileData();

现在tile.BackgroundImage 接受Uri。隔离存储中/MyFolder/MyFile.png 中的图像的完整路径是什么?

【问题讨论】:

    标签: c# windows-phone-7 windows-phone-8 windows-phone isolatedstorage


    【解决方案1】:

    试试这个

      StorageFolder folder = ApplicationData.Current.LocalFolder;
                     
                    var path = folder.Path;

    【讨论】:

      【解决方案2】:
      tile.BackgroundImage = new Uri("isostore:/MyFolder/MyFile.png", UriKind.Absolute);
      

      这里是关于 WP8 中数据的更多信息:http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402541(v=vs.105).aspx

      【讨论】:

      • 感谢您的帮助,但上面写着 An exception of type 'System.NotSupportedException' occurred 。瓷砖背景似乎不支持 IsolatedStorage 中的文件
      • 我认为图片需要位于:/Shared/ShellContent
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-26
      • 2010-10-14
      • 2011-05-08
      相关资源
      最近更新 更多