using System.Runtime.InteropServices;
[DllImport("kernel32.dll")]
public static extern bool Beep(int freq, int duration);
private void button1_Click(object sender, EventArgs e)
{
Beep(500, 100);
}