<一>visual basic beep()
1.使用visual basic beep函数;添加引用 miscorsoft visual basic runtime
2.调用 interaction.beep();
<二>使用messagebeep(unit utype):需添加 using system.runtime.interopservices;
public const int mb_iconexclamation = 48;
[dllimport("user32.dll")]
public static extern bool messagebeep(uint utype);
messagebeep( mb_iconexclamation );
<三>调用beep(int freq,int duration)函数
[dllimport("kernel32.dll")]
public static extern bool beep(int freq,int duration);
beep(800,300);
<四>调用playsound(string pszsound,int hmod,int fdwsound)
[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;
playsound("提示时奏幻想空间.wav",0,snd_async|snd_filename);
新闻热点
疑难解答