C#调用声音函数(PlaySound,Beep,MessageBeep等)
|
源代码网整理以下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); 源代码网推荐 源代码网供稿. |
