Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim FileReader As StreamReader
Dim results As DialogResult
results = OpenFileDialog1.ShowDialog
If results = Windows.Forms.DialogResult.OK Then
FileReader = New StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = FileReader.ReadToEnd()
FileReader.Close()
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim FileWriter As StreamWriter
Dim results As DialogResult
results = SaveFileDialog1.ShowDialog
If results = DialogResult.OK Then
FileWriter = New StreamWriter(SaveFileDialog1.FileName, False)
FileWriter.Write(TextBox1.Text)
FileWriter.Close()
End If
End Sub
End Class