您的位置:首页 > 编程语言 > C#

C#中播放声音文件

2010-07-09 10:08 162 查看
//播放声音文件 [DllImport("winmm.dll", EntryPoint = "PlaySound")] private static extern bool PlaySound(string pszSound, IntPtr hmod, uint fdwSound); //调用此函数 public void gosound() { string strPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; strPath = strPath + "//Music//ring.mp3"; //为声音文件所在路径 PlaySound(strPath, IntPtr.Zero, 0); }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c# string