如何访问 Windows Phone 8.1 中的下载文件夹 [英] How to access downloads folder in windows phone 8.1

查看:28
本文介绍了如何访问 Windows Phone 8.1 中的下载文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件下载到 Downloads 文件夹并阅读.它是像照片和视频一样的根文件夹.

I want to download files to Downloads folder and read. it is a root folder like photos and videos.

但是 Windows.Storage.DownloadsFolder 不适用于手机,我在 KnownFolders 中看不到它,例如 Windows.Storage.KnownFolders.PicturesLibrary;

But Windows.Storage.DownloadsFolder isn't available for phone and I don't see it in KnownFolders like Windows.Storage.KnownFolders.PicturesLibrary;

我也试过 C:\Data\Users\Public\Downloads\ 它给出了未经授权的结果.

Also I tried C:\Data\Users\Public\Downloads\ it gives an unauthorized result.

我看到一些应用可以访问它,但如何访问?

I see some apps has access to it, but how?

推荐答案

您可以使用文件或文件夹选择器.我不确定您是否希望用户选择一个文件,或者您是否想自己选择一个文件,但我认为实现这一目标的最佳方法是使用以下内容:

You can use a file or folder picker. I'm not sure if you want the user to chose a file, or if you want to pick a file yourself, but i think the best way to achieve this is using something like:

FileOpenPicker openPicker = new FileOpenPicker();
openPicker.SuggestedStartLocation = PickerLocationId.Downloads;
StorageFile file = await openPicker.PickSingleFileAsync();

FolderPicker folderPicker = new FolderPicker();
folderPicker.SuggestedStartLocation = PickerLocationId.Downloads;
folderPicker.PickFolderAndContinue();

这篇关于如何访问 Windows Phone 8.1 中的下载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆