Beep函式
语言参考
Beep 函式
PublicSuBB.htm target=_blank class=infotextkey>BBeep()
Beep 函式需要 SafeTopLevelWindows 级别的 UIPermission,这可能会对它在部分信任情况下的执行产生影响。有关更多信息,请参见请求许可权和 UIPermission Class。
示例
Visual Basic 複製代码
DimIAsIntegerForI=1To100'Loop100times.Beep'Soundatone.NextI
不支持此函式。
PrivateDeclareFunctionBeepLib"kernel32"(ByValdwFreqAsLong,ByValdwDurationAsLong)AsLong
Beep x,y
要求
模组: Interaction
程式集: Visual Basic Runtime Library(在 Microsoft.VisualBasic.dll 中)
请参见
参考
Visual Basic 运行时库成员
其他资源
播放声音
API函式
BOOLBeep(DWORDdwFreq,//soundfrequency,inhertzDWORDdwDuration//soundduration,inmilliseconds);
程式示例:
#include<windows.h>intmain(void){inti=2;while(i--){//Beep函式,使扬声器发出简单声音//要调用这个函式需要加上头档案windows.h//在VisualC++6.0下运行通过Beep(1000,1000);}return0;}
异常状况
本文由'代蓝少女'发布,不代表演示站立场,转载/删除联系作者,如需删除请-> 关于侵权处理说明。