i just wanna test it with the one login info, so i dont need to do the loop and split do i?
what i got in the file is:
guest|qwerty
nothing else
btw if u want the code i have got, it is:
code:
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'check for correct password
If txtPassword = "password" Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
frmMainMenu.Show
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
Private Sub Form_Load()
Dim strUsername, strPassword As String
Open "C:\Documents and Settings\Kevish\My Documents\A2 Computing Coursework\login.txt" For Input As #1
Do Until EOF(1)
Input #1, strUsername, strPassword
If strUsername = txtUserName And strPassword = txtPassword Then
'Do stuff if password and username match
Exit Do
End If
Loop
Close #1
End Sub