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 应用商店应用程序中的驱动器/文件夹中读取目录?
基础教程推荐
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- WPF 模态进度窗口 2022-01-01
