C# 服务程序 播放声音
[DllImport("winmm.dll")]
public static extern bool PlaySound(string pszSound, int hmod, int fdwSound);//播放提示音乐,重载
public const int SND_FILENAME = 0x00020000;
public const int SND_ASYNC = 0x0001;
/// <summary>
/// 播放声音
/// </summary>
public static void VoiceReminder()
{
string strPath = System.Windows.Forms.Application.StartupPath + "\\FailVoice.wav";
PlaySound(strPath, 0, SND_ASYNC | SND_FILENAME);//播放提示音乐
}以上是我播放声音的代码,放在客户端中是可以播放声音的,但是放在服务程序中就播放不了声音,但是我记录了日志,播放声音的代码是执行成功了,只是没有声音,为什么????
...全文


