【发布时间】:2021-03-17 16:01:50
【问题描述】:
尝试在我的应用程序中播放 .wav 文件以进行预览。
-> 正在执行以下代码:
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
player.SoundLocation = this.UnderlyingAudioFile.FullName;
player.Play();
发生错误:
System.IO.FileNotFoundException: '请确保指定位置存在声音文件。'
this.UnderlyingAudioFile.FullName;作为一个 System.IO.FileInfo 对象;
路径绝对正确。我检查了 3 次,可以从 this.UnderlyingAudioFile.FullName 复制粘贴它;
【问题讨论】:
标签: filenotfoundexception system.io.file soundplayer