Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. Dim pass As String
  2. Dim dataPass As String
  3.  
  4. Dim readLine As New StreamReader("C:tempData1.txt")
  5. Dim file As String = IO.File.ReadAllText("C:tempData1.txt")
  6.  
  7. If file = "" Then
  8. user =
  9. Button1.Text = "Save Password"
  10. Else : Button1.Text = "Login"
  11. Label1.Text = "Please Login"
  12. While Not readLine.EndOfStream
  13. Dim line1 As String = readLine.ReadLine()
  14. If line1.Contains("user= ") Then
  15. line1 = line1
  16. dataPass = line1
  17. pass = Replace(dataPass, "user= ", "")
  18. user = pass
  19. readLine.Close()
  20. FileClose("C:tempData1.txt")
  21.  
  22. readLine.Close()
  23.  
  24. Exit While
  25. End If
  26. End While
  27. End If
  28. End Sub
  29.  
  30. passwordTwo = TextBox1.Text
  31. If passwordOne = passwordTwo Then
  32. MessageBox.Show("Password Saved")
  33. Label1.Text = "What Is Your Name?"
  34. Button1.Text = "Save Name"
  35. Button3.Enabled = False
  36. Button3.Hide()
  37. Button1.Enabled = True
  38. TextBox1.Clear()
  39. Dim file As StreamWriter = My.Computer.FileSystem.OpenTextFileWriter("C:tempData1.txt", True)
  40.  
  41. file.WriteLine(passwordOne, "C:tempData1.txt")
  42.  
  43.  
  44. file.Close()
  45.  
  46. Label1.Text = "Please Enter Name"
  47.  
  48.  
  49.  
  50. Else : MessageBox.Show("Passwords Do Not Match. Please Re-Enter")
  51. End If
  52. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement