Private Sub Command1_Click()
Beep 1000,500 '1000,500 可以自行调增,得到自己想要的声音为止。
'500是'调'节声音的长短
End Sub
using Systemusing 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)
}
}
}
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As LongPrivate Sub Command1_Click()
Beep 1000,500 '1000,500 可以自行调增,得到自己想要的声音为止。
'500是'调'节声音的长短
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)