不,我认真的.
最近,我读到当PC的压电蜂鸣器以一定的频率振动时,声音会击退蚊子.
真的吗?
如何在C#中以编程方式访问PC蜂鸣器(而不是扬声器)?
我不知道蚊子,但我的头疼得像疯了似的.啊...!
ran*_*ght 16
using System.Runtime.InteropServices;
[DllImport("KERNEL32.DLL",
EntryPoint="Beep",SetLastError=true,CharSet=CharSet.Unicode,
ExactSpelling=true,CallingConvention=CallingConvention.StdCall)]
public static extern bool Beep(int pitch , int duration);
Beep(500,1000);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1905 次 |
| 最近记录: |