Guest User

Untitled

a guest
Feb 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4. ListBox1.Items.Add("Username: " & TextBox1.Text)
  5. ListBox1.Items.Add("Password: " & TextBox2.Text)
  6. End Sub
  7.  
  8. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  9. Dim Saveval As Integer = 1
  10. Dim Listpath As String = "C:\List Data Collection_" & Saveval & ".txt"
  11. Saveval = Saveval + 1
  12. For i = 0 To ListBox1.Items.Count - 1
  13. ListBox1.SetSelected(i, True)
  14. Dim Listwrite As System.IO.StreamWriter
  15. Listwrite = My.Computer.FileSystem. _
  16. OpenTextFileWriter(Listpath, True)
  17. Listwrite.WriteLine(ListBox1.Items(i))
  18. Listwrite.Close()
  19. Next
  20. End Sub
  21.  
  22. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  23. ListBox1.Items.Clear()
  24. End Sub
  25. End Class
Add Comment
Please, Sign In to add comment