Advertisement
Guest User

Untitled

a guest
Nov 12th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  2. Dim FILE_NAME As String = Cashierpath
  3. System.IO.File.Exists(FILE_NAME) ' current
  4. Dim objReader As StreamReader
  5. Dim user As String = TextBox1.Text
  6. Dim password As String = TextBox2.Text
  7. Dim check As String
  8.  
  9.  
  10. 'Global Variable
  11. 'Dim DirPath7 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Scrap DataCashier InfoCashiers")
  12.  
  13. For Each filename As String In IO.Directory.EnumerateFiles(DirPath7, "*.txt")
  14. Dim fName As String = IO.Path.GetFileName(filename)
  15. If user = fName & ".txt" Then
  16. objReader = New StreamReader(fName)
  17. check = objReader.ReadToEnd()
  18. If password = check Then
  19. MessageBox.Show("Welcome " & user & "!")
  20. Close()
  21. My.Forms.Home.Show()
  22. Else
  23. MessageBox.Show("Username or Password is incorrect")
  24.  
  25. End If
  26. End If
  27. Next
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement