Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. private void loginbutton_Click(object sender, EventArgs e)
  2. {
  3. string[] username = new string[8];
  4. string[] password = new string[8];
  5. username[0] = "user1"; password[0] = "pass1";
  6. username[1] = "user2"; password[1] = "pass2";
  7. username[2] = "user3"; password[2] = "pass3";
  8. username[3] = "user4"; password[3] = "pass4";
  9. username[4] = "user5"; password[4] = "pass5";
  10. username[5] = "user6"; password[5] = "pass6";
  11. username[6] = "user7"; password[6] = "pass7";
  12. username[7] = "glararan"; password[7] = "glararan";
  13. for (int i = 0; i < 8; i++)
  14. {
  15. if (usernamebox.Text == username[i])
  16. {
  17. if (passwordbox.Text == password[i])
  18. {
  19. MessageBox.Show("Login successful.");
  20. this.Hide();
  21. MainForm form1 = new MainForm();
  22. form1.Show();
  23. }
  24. else
  25. {
  26. //if(Script_generator___NPC_AI.Properties.Settings.Default.language.GetType == english)
  27. //{
  28. MessageBox.Show("Wrong password.");
  29. //}
  30. /*if(Script_generator___NPC_AI.Properties.Settings.Default.language.GetType == czech)
  31. {
  32. MessageBox.Show("Špatné heslo.");
  33. }*/
  34. Application.Exit();
  35. }
  36. }
  37. else
  38. {
  39. MessageBox.Show("Wrong username.Try again.");
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement