看板 C_Sharp 關於我們 聯絡資訊
各位大大好 請問,我要在ppc上執行"播放"的功能,但目前只能播.wav 我需要.wav和.mp3都能播放,該怎麼寫呢? 附上code,是能播.wav的 請大大們指點…該怎麼改才能播mp3呢?謝謝謝謝 private void btnPlay05_Click(object sender, EventArgs e) { string tmp = "aaa.wav"; if (File.Exists("\\SD 卡\\My Documents\\" + tmp)) { string path = "\\SD 卡\\My Documents\\" + tmp; try { ProcessStartInfo pInfo_play = new ProcessStartInfo(); pInfo_play.FileName = path; pInfo_play.UseShellExecute = true; Process p = Process.Start(pInfo_play); } catch (OpenNETCF.Win32.WinAPIException) { MessageBox.Show("請安裝播放軟體"); } } else { MessageBox.Show("我傻嘛~"); } } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.137.202.144
FantasyRyu:那得看看你預設用什麼放mp3 如果你沒有裝額外軟體想放 09/23 20:00
FantasyRyu:那當然不行 因為.NET本來就能放wav 但mp3要額外叫用 09/23 20:01
FantasyRyu:media player的函式庫才能放 09/23 20:01
colorsea:PPC裡有MEDIA PLAYER,但我該怎麼寫才能讓MP3能MATCH到 09/23 22:53
colorsea:MEDIA PLAYER呢?而不用另外在視窗開...謝謝 09/23 22:54
FantasyRyu:直接叫用WMP函式,不是用process開,不然一定另開視窗 09/24 12:25
colorsea:後來發現用WINDOWS APPLICATION的專案才能加入WMP元件 09/25 19:56
colorsea:用CE是叫不出來的 09/25 19:57