コード例 #1
0
        private void Login_button_Click(object sender, EventArgs e)
        {
            if (Username_textBox.Text.Equals("") && Password_textBox.Text.Equals(""))
            {
                MessageBox.Show("Please Enter The Username And Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
                if (Username_textBox.Text.Equals(""))
                {
                    MessageBox.Show("Please Enter The Username", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                    if (Password_textBox.Text.Equals(""))
                    {
                        MessageBox.Show("Please Enter The Password", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }

            if (Username_textBox.Text == username1 && Password_textBox.Text == password1 || Username_textBox.Text == username2 && Password_textBox.Text == password2)
            {
                logged_in_name = Username_textBox.Text;
                MessageBox.Show("Login Successful", "Login", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Main_Menu_Form mmf = new Main_Menu_Form();
                mmf.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Username Or Password Incorrect", "Login", MessageBoxButtons.OK, MessageBoxIcon.Error);
                attempts_count = attempts_count + 1;
            }
        }
コード例 #2
0
 private void Back_button_Click(object sender, EventArgs e)
 {
     Main_Menu_Form mmf = new Main_Menu_Form();
     mmf.Show();
     this.Close();
 }