Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Dim FILE_NAME As String = Cashierpath
- System.IO.File.Exists(FILE_NAME) ' current
- Dim objReader As StreamReader
- Dim user As String = TextBox1.Text
- Dim password As String = TextBox2.Text
- Dim check As String
- 'Global Variable
- 'Dim DirPath7 As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Scrap DataCashier InfoCashiers")
- For Each filename As String In IO.Directory.EnumerateFiles(DirPath7, "*.txt")
- Dim fName As String = IO.Path.GetFileName(filename)
- If user = fName & ".txt" Then
- objReader = New StreamReader(fName)
- check = objReader.ReadToEnd()
- If password = check Then
- MessageBox.Show("Welcome " & user & "!")
- Close()
- My.Forms.Home.Show()
- Else
- MessageBox.Show("Username or Password is incorrect")
- End If
- End If
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement