先在solution Explorer上在References按右鍵選Add References選Com加入Windows Media Player (wmp.dll)



在C#中

using WMPLib;



//create object

private WindowsMediaPlayer newMedia = new WindowsMediaPlayer();



//play music

            newMedia.URL = @"C:\Documents and Settings\LKevin\My Documents\My Music\Secret Garden\[III]Dawn Of A New Century\aquarell.mp3";

            newMedia.controls.play();


            //newMedia.controls.stop();



如此即可以撥放mp3了^^

狼翔月影 發表在 痞客邦 PIXNET 留言(0) 人氣()