I have a form that runs some code when it's loaded with the following code:

vb Code:
  1. If IO.File.Exists(config_file) Then
  2.   ' Get Music, Movies and Shows paths from config_file
  3.   fileMusic_path = IO.File.ReadAllLines(config_file).Where(Function(line) line.ToUpper().StartsWith("[MUSIC_PATH]")).First().Split("="c)(1)
  4.   fileMovies_path = IO.File.ReadAllLines(config_file).Where(Function(line) line.ToUpper().StartsWith("[MOVIES_PATH]")).First().Split("="c)(1)
  5.   fileShows_path = IO.File.ReadAllLines(config_file).Where(Function(line) line.ToUpper().StartsWith("[SHOWS_PATH]")).First().Split("="c)(1)
  6.  
  7.   ' Set path Textboxes to fileX_path variables
  8.   txtMusic_Path.Text = fileMusic_path
  9.   txtMovie_Path.Text = fileMovies_path
  10.   txtShows_Path.Text = fileShows_path
  11.  
  12. Else
  13.   txtMusic_Path.Text = "Browse to your Music storage location..."
  14.   txtMovie_Path.Text = "Browse to your Movies storage location..."
  15.   txtShows_Path.Text = "Browse to your TV Shows storage location..."
  16. End If

The form has three textboxes that contain what is read from config_file. It also has three corresponding browse buttons to browse for new directories, which changes the value of the textboxes. Then there is a Save Settings button that when clicked is suppose to eventually take the value of the textbox and replace the text in config_file with the value of the textbox currently. Basically this is updating the file with the newly browsed directory. Currently for debugging I have a message box appear with the Replace value and the Replace With values, but the Replace value is being changed to the Replace With value so it would just replace something with itself as the values are the same and I don't know why the Replace value is changing. Please help!

Here's the Save Settings button code:

vb Code:
  1. Private Sub btnSaveSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveSettings.Click
  2.   Dim reader As String
  3.   reader = My.Computer.FileSystem.ReadAllText(config_file)
  4.   'If InStr(reader, txtMusic_Path.Text) = 0 Then
  5.   'Replace(reader, Music_path, txtMusic_Path.Text)
  6.   MessageBox.Show(reader & Chr(13) & "Change this: " & txtMusic_Path.Text & Chr(13) & "Today this: " & fileMusic_path)
  7.   'End If
  8.   'If InStr(reader, txtMovie_Path.Text) = 0 Then
  9.   'Replace(reader, Movies_path, txtMovie_Path.Text)
  10.   MessageBox.Show(reader & Chr(13) & "Change this: " & txtMovie_Path.Text & Chr(13) & "Today this: " & fileMovies_path)
  11.   'End If
  12.   'If InStr(reader, txtShows_Path.Text) = 0 Then
  13.   'Replace(reader, Shows_path, txtShows_Path.Text)
  14.   MessageBox.Show(reader & Chr(13) & "Change this: " & txtShows_Path.Text & Chr(13) & "Today this: " & fileShows_path)
  15.   'End If
  16. End Sub

It's as if this code:

vb Code:
  1. ' Set path Textboxes to fileX_path variables
  2.   txtMusic_Path.Text = fileMusic_path
  3.   txtMovie_Path.Text = fileMovies_path
  4.   txtShows_Path.Text = fileShows_path

Is changing it.