让计算机发出警报声BEEP

来源:互联网 发布:图像对比度算法 编辑:程序博客网 时间:2024/06/11 17:48

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); 
        }

原创粉丝点击