首页 > 解决方案 > 在不使用 StorageFile.GetFileFromPathAsync 的情况下获取 Windows.Storage.StorageFile 对象

问题描述

StorageFile.GetFileFromPathAsync如果文件是隐藏文件或快捷方式,即使 UWP/Win32 应用程序可以使用其他 API(即...FromAppAPI,尽管它们也有一些限制)访问这些位置,API 也会失败。对于 Win32 应用程序,可以获取IShellItem对象并将其绑定到,IStorageItem但在 UWP 中这是不可能的,因为IShellItem它不适用于 UWP。有没有其他方法可以绕过StorageFile.GetFileFromPathAsync限制来获取StorageFile可以使用 UWP 应用模型完成的对象?

标签: c++windowsuwpwindows-runtimec++-winrt

解决方案


推荐阅读