Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If File.Exists("C:/TextFile.txt") Then
- Dim ioFile As New StreamReader("C:/TextFile.txt")
- Dim ioLine As String
- Dim ioLines As String
- ioLine = ioFile.ReadLine
- ioLines = ioLine
- While Not ioLine = ""
- ioLine = ioFile.ReadLine
- ioLines = ioLines & vbCrLf & ioLine
- End While
- TextBox1.Text = (ioLines)
- ioFile.Close()
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim ioFile As New StreamWriter("C:/TextFile.txt")
- ioFile.Write(TextBox1.Text)
- ioFile.Write(TextBox2.Text)
- ioFile.Write(vbNewLine
- )
- ioFile.Write(TextBox3.Text)
- ioFile.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement