Beispiel #1
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            FrmMainPg fmp = new FrmMainPg(username);

            ActiveForm.Hide();
            fmp.Show();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string Username = LoginNew.GetUName;
            //username = AdamK
            string Password = LoginNew.GetPass;

            //password = Password1

            if (Username.Equals(txtusername.Text) && (Password.Equals(txtpassword.Text)))
            {
                MessageBox.Show("Login Successful");
                FrmMainPg frm2 = new FrmMainPg(Username);
                ActiveForm.Hide();
                frm2.Show();
            }
            else if (tries < 3)
            {
                MessageBox.Show("Not Logged In Try Again");
                tries++;
            }
            else
            {
                MessageBox.Show("No more tries, the details entered are invalid");
                Environment.Exit(0);
            }
        }