【发布时间】:2013-06-21 03:00:51
【问题描述】:
我有一个使用 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());
}
}
谁能帮帮我? 谢谢!
【问题讨论】:
-
播放器实例是如何创建的?
-
System.Media.SoundPlayer player = new System.Media.SoundPlayer();
-
你混淆了服务器端播放声音和客户端stackoverflow.com/questions/12342519/…
标签: asp.net iis soundplayer playsound