public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("kernel32.dll")]public static extern bool Beep(int frequency, int duration);
private void button1_Click(object sender, EventArgs e)
{
Random random = new Random();
Beep(random.Next(10000), 1000);
}
}
C# 控制蜂鸣器
最新推荐文章于 2024-07-11 10:07:28 发布