首页 > Linux操作系统 > Linux操作系统 > Windows 的各种声音
调用.Net库的System.Media.SystemSounds库的各种发声函数,发出系统自带的声音。
1、Beep: System.Media.SystemSounds.Beep.Play()
2、Hand: System.Media.SystemSounds.Hand.Play()
3、Asterisk: System.Media.SystemSounds.Asterisk.Play()
4、Question: System.Media.SystemSounds.Question.Play()
5、Exclamation: System.Media.SystemSounds.Exclamation.Play()
6、Console Beep: Console.Beep(int frequency, int duration);
7、SoundPlayer: 声明空间using System.Media;
SoundPlayer Mplayer = new SoundPlayer();
string filename = Application.StartupPath + "";
Mplayer.SoundLocation = filename;
Mplayer.Load();
Mplayer.PlaySync();
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10897203/viewspace-1017077/ ,如需转载,请注明出处,否则将追究法律责任。