Advertisement
Guest User

Untitled

a guest
Jan 26th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. private void bunifuFlatButton2_Click(object sender, EventArgs e)
  2. {
  3. string username = textBox1.Text;
  4. bool IsRealUser = Regex.IsMatch(username, @"A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)Z");
  5. string password = textBox2.Text;
  6. bool IsRealPass = Regex.IsMatch(password, @"^(?=.*[a-z])(?=.*[A-Z])(?=.*d).{8,15}$");
  7. string email = textBox4.Text;
  8. bool IsRealEmail = Regex.IsMatch(email, @"^([0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+[a-zA-Z]{2,9})$");
  9.  
  10. if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "")
  11. {
  12. System.Windows.Forms.MessageBox.Show("Fill out the required forms!");
  13. return;
  14. }
  15. else if (textBox2.Text != textBox3.Text)
  16. {
  17. System.Windows.Forms.MessageBox.Show("Your passwords are not matching");
  18. }
  19.  
  20. else if (IsRealPass || IsRealUser || IsRealEmail)
  21. {
  22. //
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement