从 Windows 8 应用商店应用程序中的驱动器/文件夹中读取目录? [英] Read directories from a drive/folder in a Windows 8 Store app?

查看:20
本文介绍了从 Windows 8 应用商店应用程序中的驱动器/文件夹中读取目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以读取 Windows 8 应用商店应用程序中驱动器/文件夹中的所有目录/文件?除了阅读已知文件夹(文档、图片等)之外,我已经用 Google 搜索了,也许你们可以帮助我.

Is there any way to read for example all the directories/files in a drive/folder within a Windows 8 Store application? I have googled and nothing except reading the known folders (documents, pictures, etc.), maybe you guys/girls can help me out.

谢谢!

推荐答案

在 WinStore 应用程序中,对文件/文件夹的访问受到限制.

In WinStore app, access to files/folders is restricted.

您可以访问应用程序的安装文件夹,可通过 Windows.ApplicationModel.Package.Current.InstalledLocation 访问.

You have access to app's installation folder, accessible by Windows.ApplicationModel.Package.Current.InstalledLocation.

您可以通过 KnownFolders 类访问已知文件夹(文档、图片、视频等).你必须声明适当的能力.例如,如果您需要访问 VideosLibrary 文件夹,则必须定义 VideosLibrary 功能.

And you can access known folders (docs, pictures, videos, etc), through KnownFolders class. You have to decrare the appropriate capability. For example, if you need access to VideosLibrary folder, you have to define VideosLibrary capability.

其他位置的文件只能由 FilePicker 访问.

Files from other locations are accessible only by FilePicker.

更多信息,请看:

KnownFolders 类 (Windows)

Windows 应用商店应用 (Windows) 中的文件访问和权限

应用功能声明(Windows 应用商店应用)(Windows)

与文件选择器合同集成(Windows 应用商店应用程序)(Windows)

这篇关于从 Windows 8 应用商店应用程序中的驱动器/文件夹中读取目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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