软件添加背景音乐

来源:互联网 发布:tango软件好不好 编辑:程序博客网 时间:2024/05/23 16:36
 using System.Runtime.InteropServices;
  public static uint SND_ASYNC = 0x0001;  // play asynchronously
        public static uint SND_FILENAME = 0x00020000; // name is file name
        [DllImport("winmm.dll")]
        public static extern uint mciSendString(string lpstrCommand,
            string lpstrReturnString, uint uReturnLength, uint hWndCallback);
mciSendString(@"close temp_alias", null, 0, 0);
            mciSendString(@"open ""E:/音乐/完美生活.mp3"" alias temp_alias",
                null, 0, 0);
            mciSendString("play temp_alias", null, 0, 0); // 重复播放用"play temp_alias repea 
原创粉丝点击