title: How to find combine file name with file path for WMP url?
body: <p>I'm making a music player. It has two forms; first one is the typical play/stop/pause interface. second form has a checkedlistbox to choose your songs. Once I click a button in the second form, it fill a text file, with each line listing the name of each mp3 I want played.
  All the mp3s are in the same folder.
  How does one combine each line separately with the file path?</p>
  
  <p>Eg: </p>
  
  <p>song title: Crazy</p>
  
  <p>file path: C:\Users\Me\Desktop\JAM_MACHINE\JAMS</p>
  
  <p>result: C:\Users\Me\Desktop\JAM_MACHINE\JAMS\Crazy.mp3</p>
  
  <p>This is what I did:</p>
  
  <pre><code>string contents = File.ReadAllText(@"C:\Users\Me\Desktop\JAM_MACHINE\record.txt");
          var fullPath = Path.GetFullPath(contents + ".mp3");
  
          wplayer.URL = fullPath;
  </code></pre>
  
  <p>Nothing happens when I press the button that should start playing the song.</p>
  
  <p>I tried replacing <code>fullPath</code> in the third line with a fixed path, i.e. just</p>
  
  <pre><code>wplayer.URL = @"C:\Users\Me\Desktop\JAM_MACHINE\JAMS\Crazy.mp3");
  </code></pre>
  
  <p>and pressing the button to play it, and it works. So it's not the coding for the play button that's the problem.</p>
  
  <p>In addition, when I press the button, there is supposed to be a button press sound which works when I try the second code. However there is no sound when I try the first code.</p>
  
  <p>Please help me understand. Here's the full codes for your reference:</p>
  
  <pre><code>`public PLAYER()
      {
          InitializeComponent();
      }
  
      WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
      WMPLib.WindowsMediaPlayer playSFX = new WMPLib.WindowsMediaPlayer();
      WMPLib.WindowsMediaPlayer pauseSFX = new WMPLib.WindowsMediaPlayer(); //initialise all the sounds
      DataRecord songRecord = new DataRecord();
  
  
      private void PLAYER_Load(object sender, EventArgs e)//the event is actually PLAYER_Activated
      {
  
          string contents = File.ReadAllText(@"C:\Users\Me\Desktop\JAM_MACHINE\record.txt");
          var fullPath = Path.GetFullPath(contents + ".mp3");
  
          wplayer.URL = fullPath;
          playSFX.URL = @"C:\Users\Me\Desktop\JAM_MACHINE\PLAY.wav";
          pauseSFX.URL = @"C:\Users\Me\Desktop\JAM_MACHINE\PAUSE.wav";
          wplayer.controls.stop();
          playSFX.controls.stop();
          pauseSFX.controls.stop();
  
      }
  
      private void playbtn_Click(object sender, EventArgs e)
      {
          playSFX.controls.play();
          wplayer.controls.play();
      }
  
      private void pausebtn_Click(object sender, EventArgs e)
      {
          pauseSFX.controls.play();
          wplayer.controls.pause();
      }
  
      private void stopbtn_Click(object sender, EventArgs e)
      {
          pauseSFX.controls.play();
          wplayer.controls.stop();
          this.Visible = false;
          JAMS JAMS = new JAMS();
          JAMS.ShowDialog();
  
          if(JAMS.Visible == false)//if jams isnt open, open it
          {
              this.Visible = true;
          }
      }`
  </code></pre>