如何在 WinRT 中播放 D 盘上的视频文件?

编程入门 行业动态 更新时间:2024-10-25 12:26:19
本文介绍了如何在 WinRT 中播放 D 盘上的视频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在 WindowsMetro"应用程序中使用 XAML C# 如何播放某个视频文件.示例:

Using XAML C# in Windows "Metro" Apps how do I go about playing a certain video file. Examples:

  • D:\video1.wmv
  • \\MEDIAPC\video2.wmv

到目前为止,我设法让它工作的唯一方法是使用 FilePicker,但我不想使用它,因为我已经有了要播放的文件列表.

The only way I managed to get this working so far is by using FilePicker, but I don't want to use this as I already have a list of files to play.

我曾尝试使用 GetFileFromPathAsync,但我不断遇到权限/访问问题

I have tried to use GetFileFromPathAsync but I keep getting permission / access issues

await StorageFile.GetFileFromPathAsync(@"D:\video1.wmv");

抱歉,如果有人回答了这个问题,我只是找不到适合我的问题的答案.

Apologies if this has been answered I just couldn't find an answer that fits my problem.

推荐答案

如果您的 D:\ 驱动器是非网络资源,请尝试添加可移动存储应用程序功能.这可以通过双击 Package.appxmanifest 并导航到 Capabilities 选项卡来完成.默认情况下,您的应用程序(假设它是 Windows 应用商店应用程序)只能访问与您的应用程序一起打包的本地文件或存储在 local/roaming/temp 文件夹(通常为应用程序状态保留)中的文件.

If your D:\ drive is a non-network resource try adding the Removable storage application capability. This can be accomplished by double-clicking on the Package.appxmanifest and navigating to the Capabilities tab. By default your application (assuming it is a Windows Store app) only has access to local files packaged with your app or files stored in local/roaming/temp folders (usually reserved for Application state).

如果您的数据存储在需要身份验证的网络资源上,您将需要启用企业身份验证功能.

If your data is stored on a Network resource that requires authentication you will want to enable the Enterprise Authentication capability.

如果您不访问需要网络身份验证的资源,您可能还想为 \MEDIAPC\ 文件处理家庭和工作网络.

You may also want to fiddle with the Home and Work Networks for the \MEDIAPC\ files if you aren't accessing resources that require network authentication.

进一步阅读:

  • 访问数据和文件
  • 如何从文件加载数据
  • 应用功能概述

更多推荐

如何在 WinRT 中播放 D 盘上的视频文件?

本文发布于:2023-07-11 09:23:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1093570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视频文件   如何在   WinRT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!