C#调用声音函数(PlaySound,Beep,MessageBeep等) - 中国WEB开发者网络 (http://www.webasp.net) -- 技术教程 (http://www.webasp.net/article/) --- C#调用声音函数(PlaySound,Beep,MessageBeep等) (http://www.webasp.net/article/29/28123.htm) |
| -- 作者:未知 -- 发布日期: 2007-01-16 |
C# 调用声音文件,包括API函数和调用VisualBasic函数
<一>Visual Basic Beep() 1.使用Visual Basic Beep函数;添加引用 Miscorsoft Visual Basic Runtime
2.调用 Interaction.Beep(); <二>使用MessageBeep(unit uType):需添加 using System.Runtime.InteropServices; public const int MB_ICONEXCLAMATION = 48; [DllImport("user32.dll")] MessageBeep( MB_ICONEXCLAMATION ); <三>调用Beep(Int freq,int duration)函数 [DllImport("kernel32.dll")] Beep(800,300); <四>调用PlaySound(string pszSound,int hmod,int fdwSound) PlaySound("提示时奏幻想空间.WAV",0,SND_ASYNC|SND_FILENAME);
|
| webasp.net |