Advertisement
mariussm

Untitled

Aug 30th, 2013
1,242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. protected bool VerifyPIN(string username, string PIN)
  2. {
  3.     return PIN.Equals("12345")
  4. }
  5.  
  6. protected void SubmitButton_Click( object sender, EventArgs e )
  7. {
  8.     try
  9.     {
  10.         if(!VerifyPIN(UsernameTextBox.Text, PINTextBox) {
  11.             ErrorTextLabel.Visible = true;
  12.             ErrorTextLabel.Text = "Wrong PIN"
  13.             return;
  14.         }
  15.        
  16.         // PIN was ok, let's continue with SignIn
  17.         SignIn( UsernameTextBox.Text, PasswordTextBox.Text );
  18.     }
  19.     catch ( AuthenticationFailedException ex )
  20.     {
  21.         HandleError( ex.Message );
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement