k guys i have a text file that has a record of passwords, i am trying to read from that file if the guys username and passwords match access granted if not there denied.
read = System.IO.File.OpenText("password records.txt") username = txtUsername.Text For a = 1 To 10 txtOutput.Text = read.Readline() If InStr(txtOutput.Text, username) Then count = txtOutput.Text.Length.ToString - 8 password = Mid(txtOutput.Text, count, 9) End If Next a read.Close() correctPass = txtPassword.Text If correctPass = password Then MsgBox("You Have Gained Access!") Else MsgBox("Access Denied! Try Again!" & vbCrLf _ & "If not registered please Press ""Click here to REGISTER""") End If
this is my code, but whenever i try it the password doesn't return anything.