我想从我的 UWP 应用程序运行一个文件(视频、音乐、图片......)。对于 WPF,我可以使用 Process.Start(path)
方法,但此方法现在可用于 UWP。我发现我可能应该使用 FullTrustProcessLauncher
( https://docs.microsoft.com/en-us/uwp/api/Windows.ApplicationModel.FullTrustProcessLauncher ),但我不明白它是如何工作的。当我只有一个 path
时,有人可以在这里给我写一些非常示例如何使用它或其他什么以及我如何使用它来解决这个问题。的文件?谢谢你。
最佳答案
我会尝试这样的事情。这将打开一个 wmv
Windows.System.LauncherOptions options = new Windows.System.LauncherOptions();
options.ContentType = "video/x-ms-wmv";
Windows.System.Launcher.LaunchUriAsync(new Uri(fileUrl), options);
关于c# - UWP 中的 Process.Start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52328519/