【问题标题】:Acess file from isolated storage using its full path as URI使用完整路径作为 URI 从隔离存储访问文件
【发布时间】:2014-08-06 14:25:17
【问题描述】:

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

那么有可能吗?

【问题讨论】:

  • 看看MSDN
  • @Romasz 它不是独立存储相关的。
  • 您要获取存储在隔离存储中的图像的源路径吗?

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


【解决方案1】:

我是这样理解的:

 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.
            }
        }
    }

【讨论】:

    猜你喜欢
    • 2023-04-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    • 2019-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多