Read directories from a drive/folder in a Windows 8 Store app?(从 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 应用商店应用程序中的驱动器/文件夹中读取目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 Windows 8 应用商店应用程序中的驱动器/文件夹中读取目录?
基础教程推荐
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 如果条件可以为空 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 将数据集转换为列表 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 从 C# 控制相机设备 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
