我想将文件下载到 Downloads
文件夹并阅读。它是像照片和视频一样的根文件夹。
但是 Windows.Storage.DownloadsFolder
不适用于手机,我在 KnownFolders
中也看不到它,例如 Windows.Storage.KnownFolders.PicturesLibrary;
我还尝试了 C:\Data\Users\Public\Downloads\
它给出了未经授权的结果。
我看到一些应用可以访问它,但如何访问它?
最佳答案
您可以使用文件或文件夹选择器。 我不确定你是想让用户选择一个文件,还是你想自己选择一个文件,但我认为实现这一点的最好方法是使用类似的东西:
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.SuggestedStartLocation = PickerLocationId.Downloads;
StorageFile file = await openPicker.PickSingleFileAsync();
或
FolderPicker folderPicker = new FolderPicker();
folderPicker.SuggestedStartLocation = PickerLocationId.Downloads;
folderPicker.PickFolderAndContinue();
关于c# - 如何访问Windows Phone 8.1 中的下载文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23340398/