vb.net - my log in form logic seems flawed and i cant figure it out -
im making log in form users can input details main program, , (eventually) users able change passwords
my "passwords.txt" file contains:
123 password
and code executes see whether username , password correct or not
imports system.io public class login public structure info dim username string dim password string end structure dim details info private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click if txtusername.text = details.password , txtpassword.text = details.password form1.show() me.hide() else msgbox("your username or password incorrect!") txtpassword.text = "" txtusername.text = "" end if end sub private sub login_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim file = system.io.file.readalllines("passwords.txt") dim myarray string() = file details.username = myarray(0) details.password = myarray(1) end sub end class
no matter put txtusername , txtpassword shows message box
i think problem you're checking txtusername against details.password instead of details.username. :)
Comments
Post a Comment