Win7下如何让主板的Beep蜂鸣器响起来

Win7下如何让主板的Beep蜂鸣器响起来,第1张

using System

using System.Collections.Generic

using System.ComponentModel

using System.Data

using System.Drawing

using System.Linq

using System.Text

using System.Windows.Forms

using System.Runtime.InteropServices

namespace WindowsFormsApplication1

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent()

}

[DllImport("kernel32.dll")]

private static extern int Beep(int dwFreq, int dwDuration)

private void button1_Click(object sender, EventArgs e)

{

Beep(0X7FF, 1000)

}

}

}

.版本 2

.DLL命令 Beep, 逻辑型, , "Beep"

.参数 dwFreq

.参数 dwDuration

就可以

参数1 为声音 1-999 之间

参数2 为播放速度 1-99


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/7805131.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-10
下一篇 2023-04-10

发表评论

登录后才能评论

评论列表(0条)

保存