Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Form1()
- {
- InitializeComponent();
- }
- string[] names = new string[2];
- string[] ussernames = { "ussername1", "ussername2" };
- string[] passwords = { "password1", "password2" };
- int i = 0;
- private void button1_Click(object sender, EventArgs e)
- {
- if (ussernames.Contains(textBox1.Text) && passwords.Contains(textBox2.Text) && Array.IndexOf(ussernames, textBox1.Text) == Array.IndexOf(passwords, textBox2.Text))
- {
- Form2 f2 = new Form2();
- f2.ShowDialog();
- }
- else
- MessageBox.Show("The username or password is incorrect");
- }
- private void button2_Click(object sender, EventArgs e)
- {
- for (i = 0; i < names.Length; i = i++)
- {
- textBox1.Text += names[i];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement