看板 C_Sharp 關於我們 聯絡資訊
※ 引述《leicheong (睡魔)》之銘言: : ※ 引述《colorsea (OH Yes! Babe~)》之銘言: : 啊, 不好意思. winmm.dll不是COM+ library不可以這樣做的... : 你需要用那些function? 我可以幫你把方法給做出來... : 像是PlaySound的話: : [DllImport("winmm.dll", CharSet = CharSet.Unicode, SetLastError=true)] : public static extern bool PlaySound (string lpszName, System.IntPtr hModule, : int dwFlags); 其實我要做的功能,就是要讀.mp3的檔案而已(明明就超難還寫而已XD) 我目前已經有寫這樣: //[DllImport("winmm.dll")] //public static extern int PlaySound(string name, int hmod, int flags); //public const int SND_SYNC = 0x0; //public const int SND_ASYNC = 0x1; //public const int SND_FILENAME = 0x20000; //public const int SND_RESOURCE = 0x40004; //public void PlaySoundFile(string filename) //{ // PlaySound(filename, 0, SND_FILENAME | SND_ASYNC); //} private void btnPlay06_Click_1(object sender, EventArgs e) { //來播吧! //PlaySound("\\SD 卡\\My Documents\\aaa.mp3", 0, SND_FILENAME | SND_ASYNC); } 可是呢,一RUN就說找不到winmm.dll檔>"< 這樣還有救嗎?謝謝阿~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.126.222