Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Imports System.IO
  2. Public Class Form1
  3.  
  4. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. If File.Exists("C:/TextFile.txt") Then
  6. Dim ioFile As New StreamReader("C:/TextFile.txt")
  7. Dim ioLine As String
  8. Dim ioLines As String
  9. ioLine = ioFile.ReadLine
  10. ioLines = ioLine
  11. While Not ioLine = ""
  12. ioLine = ioFile.ReadLine
  13. ioLines = ioLines & vbCrLf & ioLine
  14. End While
  15. TextBox1.Text = (ioLines)
  16. ioFile.Close()
  17. End If
  18. End Sub
  19.  
  20. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  21.  
  22. Dim ioFile As New StreamWriter("C:/TextFile.txt")
  23. ioFile.Write(TextBox1.Text)
  24. ioFile.Write(TextBox2.Text)
  25. ioFile.Write(vbNewLine
  26. )
  27. ioFile.Write(TextBox3.Text)
  28. ioFile.Close()
  29. End Sub
  30. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement