Advertisement
Guest User

vb sample

a guest
Nov 1st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Private Sub cmdLogin_Click()
  2.  
  3. Print Encrypt(txtUsername1.Text, 14)
  4.  
  5.  
  6.  
  7. Dim username As String
  8. Dim Password As String
  9. Dim found As Boolean
  10.  
  11. found = False
  12.  
  13.  
  14. Open "M:\Computing\VB\users.dat" For Input As #1
  15.  
  16. Do While Not EOF(1) And found = False
  17.  
  18. Input #1, username, Password
  19.  
  20. If username = txtUsername1.Text And Decrypt(Password, 14) = txtPassword1.Text Then
  21. 'match
  22.  
  23. found = True
  24. End If
  25.  
  26. Loop
  27. Close #1
  28.  
  29. If found = True Then
  30.  
  31. Me.Hide
  32. frmCPanel.Show
  33.  
  34. ElseIf found = False Then
  35.  
  36. MsgBox "Incorrect Username/Password"
  37. txtPassword1 = ""
  38. txtUsername1.SetFocus
  39.  
  40. End If
  41.  
  42. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement