Here's the code:
vb Code:
Private Sub btnSaveSettings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveSettings.Click Dim reader As String reader = My.Computer.FileSystem.ReadAllText(config_file) Replace(reader, Music_path, txtMusic_Path.Text) Replace(reader, Movies_path, txtMovie_Path.Text) Replace(reader, Shows_path, txtShows_Path.Text) MessageBox.Show(reader) End Sub
Upon running this section of code reader is being set to.
[MUSIC_PATH]=X:\Multimedia\Audio
[MOVIES_PATH]=C:\Media\Movies
[SHOWS_PATH]=C:\Media\TV Shows
When the code is run the textboxes values are as follow.
txtMusic_Path = X:\Multimedia\Audio
txtMovies_Path = C:\Media
txtShows_Path = C:\Media\TV Shows
At the end when the MessageBox.Show() is run it displays.
[MUSIC_PATH]=X:\Multimedia\Audio
[MOVIES_PATH]=C:\Media\Movies
[SHOWS_PATH]=C:\Media\TV Shows
Why isn't it coming out as this?
[MUSIC_PATH]=X:\Multimedia\Audio
[MOVIES_PATH]=C:\Media
[SHOWS_PATH]=C:\Media\TV Shows
Thanks!




Reply With Quote