当前位置:网站首页>C# 调用系统声音 嘀~
C# 调用系统声音 嘀~
2022-07-02 06:32:00 【清山博客】
public class BeepUp
{
/// <param name="iFrequency">声音频率(从37Hz到32767Hz)。在windows95中忽略</param>
/// <param name="iDuration">声音的持续时间,以毫秒为单位。</param>
[DllImport("Kernel32.dll")] //引入命名空间 using System.Runtime.InteropServices;
public static extern bool Beep(int frequency, int duration);
}
调用方法:
BeepUp.Beep(3200, 100);
声音频率 和 持续时间 可以自行调整。
边栏推荐
猜你喜欢
Web security -- core defense mechanism
2022 Heilongjiang latest food safety administrator simulation exam questions and answers
IP协议与IP地址
STM32 new project (refer to punctual atom)
Kubernetes deploys Loki logging system
C language custom type enumeration, Union (clever use of enumeration, calculation of union size)
Synchronize files using unison
Getting started with k8s: building MySQL with Helm
ICMP Protocol
Minecraft模组服开服
随机推荐
Hcia - Application Layer
ICMP协议
Realize bidirectional linked list (with puppet node)
Learning C
Web技术发展史
Gateway is easy to use
整理秒杀系统的面试必备!!!
Don't know mock test yet? An article to familiarize you with mock
Openshift build image
旋转链表(图解说明)
Viewing JS array through V8
c语言自定义类型枚举,联合(枚举的巧妙使用,联合体大小的计算)
idea中注释代码取消代码的快捷键
Shortcut key to comment code and cancel code in idea
sqli-labs第1关
commands out of sync. did you run multiple statements at once
gocv图片裁剪并展示
Rotating linked list (illustration)
Qt QTimer类
web安全--逻辑越权