c#中用声音提示报警(转)
using System;?
using System.Runtime.InteropServices;?
調(diào)用?Interaction.Beep();
使用MessageBeep(unit uType):需添加?using System.Runtime.InteropServices;
public const int MB_ICONEXCLAMATION =? 48;
??[DllImport("user32.dll")]
??public static extern bool MessageBeep(uint uType);
MessageBeep( MB_ICONEXCLAMATION );
調(diào)用Beep(Int freq,int duration)函數(shù)
??[DllImport("kernel32.dll")]
??public static extern bool Beep(int freq,int duration);
Beep(800,300);
調(diào)用PlaySound(string pszSound,int hmod,int fdwSound)
??[DllImport("winmm.dll")]
??public static extern bool PlaySound(string pszSound,int hmod,int fdwSound);
??public const int SND_FILENAME = 0x00020000;
??public const int SND_ASYNC = 0x0001;
PlaySound("提示時奏幻想空間.WAV",0,SND_ASYNC|SND_FILENAME);c#中用聲音提示報警
轉(zhuǎn)載于:https://www.cnblogs.com/qiaoheng/archive/2012/05/10/2493777.html
總結(jié)
以上是生活随笔為你收集整理的c#中用声音提示报警(转)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【问题收集·知识储备】Xcode只能选择
- 下一篇: Unity c# 状态机的简单入门