Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As IO.File
Select Case f.Exists("C:\test123.txt")
Case True /// if it exsists put the text from it to a textbox.
Dim sr As IO.StreamReader = New IO.StreamReader(New IO.FileStream("C:\test123.txt", IO.FileMode.Open))
TextBox1.AppendText(sr.ReadToEnd)
sr.Close()
Case False ///if it doesnt exsist , create it and add some text to it.
Dim sr As IO.StreamWriter = New IO.StreamWriter(New IO.FileStream("C:\test123.txt", IO.FileMode.Create))
sr.Write("some text in a new text file!")
sr.Close()
End Select
End Sub