我有一个使用 SoundPlayer 类播放波形文件的应用程序。但是,当我在 IIS 中发布应用程序时,该文件将无法播放。要使用 SoundPlayer 类我添加了一个参考 windows.dll,它可能会干扰?
public void PlaySound()
{
try
{
while (1 == 1)
{
List<string> distinctMusic = GetMusicFile.Distinct().ToList();
for (int i = 0; i < distinctMusic.Count; i++)
{
player.SoundLocation = distinctMusic[i];
player.Play();
Thread.Sleep(GetMusicDuration[i] * 1000);
player.Stop();
}
player.Dispose();
}
}
catch (Exception e)
{
//log.LogTxt(e.ToString());
}
}
谁能帮我?谢谢 !