Function
< a >visual Basic Beep ()
1. Use Visual Basic beep functions; Add references miscorsoft Visual Basic Runtime
2. Call Interaction.Beep ();
< two > Using MessageBeep (Unit Utype): Need to add using System.Runtime.InteropServices;
public const int mb_iconexclamation = 48;
[DllImport ("user32.dll")]
public static extern bool MessageBeep (UINT utype);
MessageBeep (mb_iconexclamation);
< three > Call beep (Int freq,int duration) function
[DllImport ("kernel32.dll")]
public static extern bool Beep (int freq,int duration);
Beep (800,300);
< four > Call 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 ("Play fantasy space when prompted.") WAV ", 0,snd_async| Snd_filename);