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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -