我想从路径手动创建StorageFile
,但StorageFile
没有构造函数。
有没有一种简单的方法来做这样的事情?
StorageFile f = new StorageFile("C:\song.mp3");
答案 0 :(得分:4)
您需要使用StorageFile.GetFileFromPathAsync API:
答案 1 :(得分:3)
StorageFile file = await StorageFile.GetFileFromPathAsync(item.Path);