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

问题描述 投票:0回答:1

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

那有可能吗?

windows-phone-7 windows-phone-8 windows-phone-8.1 isolatedstorage
1个回答
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.
            }
        }
    }
© www.soinside.com 2019 - 2024. All rights reserved.