C#使电脑发出嗡鸣声

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace 鸣笛
{
    class Program
    {
       
        static void Main(string[] args)
        {
            
           BeepOn.Beep(500, 700);
            Console.ReadKey();

        }
       
    }

   public  class  BeepOn
 {
    [DllImport("Kernel32.dll")]
    public static extern bool Beep(int a, int b);
 }

}

原文地址:https://www.cnblogs.com/secbook/p/2654882.html