xaml - Login administrator c# from local database bug -


i have problem when try connect admin c# application.

i have created local database stock main informations such username, password...

when user enter login interface, enter user name , password, click login this:

<textbox name="usernamebox"></textbox> <passwordbox name="passwordbox"></passwordbox> <button content="connection" click="connectionclick"></button> 

the event click role check if admin can log in, or not:

private void  connectionclick(object sender, routedeventargs e) {     var username = usernamebox.text;     var password = passwordbox.password;      admin admin = new admin();      if((username == admin.username) && (password == admin.password))     {         this.close()         mainpage retourpageprincipale = new mainpage();         retourpageprincipale.show();     }     else     {         messagebox.show("bad username/password combo!");     } } 

i have created fake users local database (admin) , when enter correct login/password, have messagebox. have messagebox.

does know doing wrong?

i won't give answer, show should done in such cases:

  1. try debug - put break point in line if((username == admin.username) && (password == admin.password)) , using watch expression try find out problem
  2. if step 1 impossible - try log file, remember after find bug delete logging because log admin password :)

above steps should give answer


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -