top of your code window ...
VB Code:
  1. [COLOR=Green]/// add these 2 references ... [/COLOR]
  2. [COLOR=Blue]using[/COLOR] System.Runtime.InteropServices;
  3. [COLOR=Blue]using[/COLOR] System.Text;
to use, a simple bit of code that allows you to open / play / stop an mp3 i put together ...
VB Code:
  1. [DllImport("winmm.dll", EntryPoint="mciSendStringA")]
  2.         [COLOR=Blue]private static extern int [/COLOR] mciSendString ([COLOR=Blue]string[/COLOR] lpstrCommand, [COLOR=Blue]string[/COLOR] lpstrReturnString, [COLOR=Blue]int[/COLOR] uReturnLength, [COLOR=Blue]int[/COLOR] hwndCallback);
  3.         [DllImport("kernel32.dll", EntryPoint="GetShortPathNameA")]
  4.         [COLOR=Blue]private static extern int[/COLOR] GetShortPathName ([COLOR=Blue]string[/COLOR] lpszLongPath, StringBuilder lpszShortPath, [COLOR=Blue]int[/COLOR] cchBuffer);
  5.  
  6.         [COLOR=Blue]private string[/COLOR] Alias = "MP3";
  7.  
  8.         [COLOR=Blue]private void[/COLOR] btnplay_Click([COLOR=Blue]object[/COLOR] sender, System.EventArgs e)
  9.         {
  10.             OpenFileDialog od = [COLOR=Blue]new[/COLOR] OpenFileDialog();
  11.             od.Filter = "MP3 Audio(*.mp3)|*.mp3";
  12.             od.RestoreDirectory = [COLOR=Blue]false[/COLOR];
  13.             [COLOR=Blue]if[/COLOR](od.ShowDialog() == DialogResult.OK)
  14.             {
  15.                [COLOR=Green] /// we need to get the short path name of our file
  16.                 /// eg: E:\Iron Maiden\(1980) Iron Maiden\04 - Phantom Of The Opera.mp3
  17.                 /// becomes  E:\IRONMA~1\(1980)~1\04-PHA~1.MP3
  18.                 /// to do this we use the GetShortPathName API
  19.                 /// and the System.Text.StringBuilder class to receive the ShortPathName. [/COLOR]                
  20.                 StringBuilder sbuild = [COLOR=Blue]new[/COLOR] StringBuilder(256);
  21.                 GetShortPathName(od.FileName , sbuild , sbuild.Capacity);
  22.  
  23.                 Play(sbuild.ToString());
  24.             }
  25.         }
  26.  
  27.         [COLOR=Blue]private void[/COLOR] Play([COLOR=Blue]string[/COLOR] Mp3)
  28.         {
  29.             [COLOR=Green]/// open the mp3 file ( mp3 uses the Type MPEGVideo ) [/COLOR]
  30.             [COLOR=Blue]int[/COLOR] x = mciSendString("open " + Mp3 + " Type MPEGVideo Alias " + Alias , [COLOR=Blue]null[/COLOR] , 0 , 0);
  31.             [COLOR=Green]/// play the mp3 [/COLOR]
  32.             x = mciSendString("play " + Alias , [COLOR=Blue]null[/COLOR] , 0 , 0);
  33.         }
  34.  
  35.         [COLOR=Blue]private void[/COLOR] Stop()
  36.         {
  37.             [COLOR=Blue]int[/COLOR] x = mciSendString("stop " + Alias , [COLOR=Blue]null[/COLOR] , 0 , 0);
  38.         }
  39.  
  40.         [COLOR=Blue]private void[/COLOR] btnstop_Click([COLOR=Blue]object[/COLOR] sender, System.EventArgs e)
  41.         {
  42.             Stop();
  43.         }
hope it helps