Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. public Form1()
  2. {
  3. InitializeComponent();
  4. }
  5. string[] names = new string[2];
  6.  
  7. string[] ussernames = { "ussername1", "ussername2" };
  8. string[] passwords = { "password1", "password2" };
  9. int i = 0;
  10.  
  11.  
  12. private void button1_Click(object sender, EventArgs e)
  13. {
  14. if (ussernames.Contains(textBox1.Text) && passwords.Contains(textBox2.Text) && Array.IndexOf(ussernames, textBox1.Text) == Array.IndexOf(passwords, textBox2.Text))
  15. {
  16. Form2 f2 = new Form2();
  17. f2.ShowDialog();
  18. }
  19. else
  20. MessageBox.Show("The username or password is incorrect");
  21. }
  22.  
  23. private void button2_Click(object sender, EventArgs e)
  24. {
  25. for (i = 0; i < names.Length; i = i++)
  26. {
  27. textBox1.Text += names[i];
  28. }
  29.  
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement