我怎样才能使在C#中的电脑提示音? [英] How can I make the computer beep in C#?

查看:194
本文介绍了我怎样才能使在C#中的电脑提示音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在C#中计算机的内部喇叭鸣叫无需外接音箱?

How do I make the computer's internal speaker beep in C# without external speakers?

推荐答案

在NET 2.0中,你可以使用Console.Beep()。

In .Net 2.0, you can use Console.Beep().

// Default beep
Console.Beep();

您也可以指定以毫秒为单位的提示音的频率和长度。

You can also specify the frequency and length of the beep in milliseconds.

// Beep at 5000 Hz for 1 second
Console.Beep(5000, 1000);

有关详细信息,请参阅<一href="http://msdn.microsoft.com/en-us/library/8hftfeyw%28v=vs.110%29.aspx">http://msdn.microsoft.com/en-us/library/8hftfeyw%28v=vs.110%29.aspx

这篇关于我怎样才能使在C#中的电脑提示音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆