使用 .Net 启动 Windows 媒体播放器

Starting Windows Media Player with .Net

我正在尝试从我的 .net 应用程序启动 windows 媒体播放器。

以前在 .Net 4.8 中,以下代码运行良好:

Process.Start("wmplayer.exe", this.UnderlyingAudioFile.FullName);

现在使用 .Net,调用时会出现以下错误: System.ComponentModel.Win32Exception: 'The system cannot find the file specified.'

有什么解决办法吗?

错误消息具有误导性。 错误实际上是 Binary reader 阻塞了其他线程的文件。

确保打开文件,使文件访问其他线程,例如:

this.Reader = new BinaryReader(File.Open(path,FileMode.Open,FileAccess.Read,FileShare.Read));