整理代码块
代码块整理后存储,供后期使用
计算机蜂鸣
class Program
{
static void Main(string[] args)
{
while (true)
{
Console.WriteLine("please press num \"1\" or \"2\"");
int num = Convert.ToInt32(Console.ReadLine());
if (num == 1)
if (Beep(3000, 5000))
Console.WriteLine("成功");
else
Console.WriteLine("失败");
else
{
if (Beep(500, 700))
Console.WriteLine("成功");
else
Console.WriteLine("失败");
}
}
}
[DllImport("Kernel32.dll")]
// 頻率 持續時間
public static extern bool Beep(int frequency, int duration);
}
标签:Console,计算机,蜂鸣,int,代码,Beep,num,WriteLine
From: https://www.cnblogs.com/Katakana/p/17917657.html