// 声明
public class BeepUp
{
/// <param name="iFrequency">声音频率(从37Hz到32767Hz)。在windows95中忽略</param>
/// <param name="iDuration">声音的连续时间,,以毫秒为单位。</param>
[DllImport("Kernel32.dll")] //引入定名空间 using System.Runtime.InteropServices;
public static extern bool Beep(int frequency, int duration);
}
// 挪用
BeepUp.Beep(500, 700); // 这个声音还不错