gpt4 book ai didi

c# - 如何访问SD卡上的视频

转载 作者:行者123 更新时间:2023-12-02 09:22:05 25 4
gpt4 key购买 nike

我目前正在为 Windows Phone 8 开发一个视频播放器,它将显示所有视频的列表(存储在手机内存和 SD 卡中)。

我没有找到任何使用 ExternalStorageDevice 类访问系统保留文件和文件夹的方法。

ExternalStorageDevice _sdCard = (await ExternalStorage.GetExternalStorageDevicesAsync()).FirstOrDefault();

var folders = await _sdCard.RootFolder.GetFoldersAsync();

MessageBox.Show(folders.Count().ToString());

通过使用此代码,我获得了其他文件夹,但没有获得图片、音乐和视频等系统文件夹。

而且我没有直接位于根文件夹中的 .mp4 文件。

请帮我解决这个问题。

提前致谢。

最佳答案

您将无法让它工作(目前 - 因为许多文件被保留并且第三方应用程序无法访问)。

通常要查看 SD 卡上的文件,您必须注册扩展名 - point 2 at MSDN :

To read a file, your app must register for a file association in the app manifest file and declare what file types (extensions) it can handle.

不幸的是(正如我所提到的)许多文件被保留( list is here ):

But there are some file and URI associations that you can’t use, associations that are reserved. If your app registers for a reserved association, that registration will be ignored.

所以目前您的应用程序不可能看到这些文件。

关于c# - 如何访问SD卡上的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22424759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com