Windows服务中如何播放声音
不用多说,直接上代码:
System.Media.SoundPlayer sp = new System.Media.SoundPlayer(); sp.SoundLocation = @"D:\tmp\wav\1.wav"; sp.PlaySync(); sp.SoundLocation = @"D:\tmp\wav\2.wav"; sp.PlaySync(); sp.SoundLocation = @"D:\tmp\wav\3.wav"; sp.PlaySync(); sp.Dispose();