在Vb.net 里怎么让主板发出声音,谢谢,是vb.net,不是vb

解决方案 »

  1.   

    VB.NET也可以调用API的。另外,主板上有喇叭吗?应该是机箱上的喇叭吧
      

  2.   

    用Beep函数【VB声明】
      Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long【说明】
      用于生成简单的声音 【返回值】
      Long,TRUE(非零)表示成功,否则返回零。会设置GetLastError 【备注】
      在windows95中,这个函数简单的播放默认系统响铃【参数表】
      dwFreq ---------  Long,声音频率(从37Hz到32767Hz)。在windows95中忽略  dwDuration -----  Long,声音的持续时间,以毫秒为单位。如为-1,表示一直播放声音,直到再次调用该函数为止。在windows95中会被忽略
      

  3.   

    API各种编程工具都可用,Beep函数----可能是最简单的API了
      

  4.   

    API各种编程工具都可用,Beep函数----可能是最简单的API了
      

  5.   


    Module Module1
        Private Declare Function MessageBeep Lib "user32" Alias "MessageBeep" (ByVal wType As Integer) As Integer
        Sub Main()
            MessageBeep(0)
        End SubEnd Module
      

  6.   

    主板本来是不能发声的,只是让随机带的小喇叭发出声音,这可以通过Beep函数实现,由于我的小喇叭没有插线,故使用了MessageBeep,把上述代码改成Beep就可以了。
      

  7.   

    方法1:
    Private Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As integer, ByVal dwDuration As integer) As integer方法2:
    用锤子砸