使用其完整路径作为URI从隔离存储中访问文件

时间:2014-08-06 14:25:17

标签: windows-phone-7 windows-phone-8 windows-phone-8.1 isolatedstorage

我想使用完整路径(如URI)在隔离存储中使用该文件,我知道有沙盒api可以访问隔离存储。但我必须使用他们的路径加载图像。

有可能吗?

1 个答案:

答案 0 :(得分:0)

我是这样的:

 public string GetAbsolutePathOfFile(string filePath)
    {
        using (var storage = IsolatedStorageFile.GetUserStoreForApplication())
        {
            using (var isfs = storage.OpenFile(filePath, FileMode.Open, FileAccess.ReadWrite,
                    FileShare.ReadWrite))
            {
                return isfs.Name; // this return the absolute path.
            }
        }
    }