コード例 #1
0
 private void DummyEmail_Load(object sender, EventArgs e)
 {
     if (UserForgotPassword.fromThis)
     {
         Verifcation vf = new Verifcation();
         lblCODE.Text = vf.getPasswordfromEmail(UserForgotPassword.email);
     }
     else
     {
         Signin s = new Signin();
         lblCODE.Text = s.getCipher(UserSignin.username);
     }
 }
コード例 #2
0
 private void DummyMobileMessage_Load(object sender, EventArgs e)
 {
     if (UserForgotPassword.fromThis)
     {
         Verifcation vf = new Verifcation();
         lblCODE.Text = vf.getPassword(UserForgotPassword.number);
     }
     else
     {
         Signin s = new Signin();
         lblCODE.Text = s.getCipher(UserSignin.username);
         //SecurityCode.cipher = lblCODE.Text;
     }
 }
コード例 #3
0
        private void SecurityCode_Load(object sender, EventArgs e)
        {
            Signin s = new Signin();

            SecurityCode.cipher = s.getCipher(UserSignin.username);
        }
コード例 #4
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            Signin signin = new Signin();

            if (txtUsername.Text == "" && txtPassword.Text == "")
            {
                MessageBox.Show("Please! Enter UserName and Password", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (txtUsername.Text == "")
            {
                MessageBox.Show("Please! Enter UserName", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (txtPassword.Text == "")
            {
                MessageBox.Show("Please! Enter Password", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (signin.checkCipher(txtUsername.Text))
                {
                    //Open Cipher Form
                    if (signin.AuthenticateUser(txtUsername.Text, txtPassword.Text))
                    {
                        this.Hide();
                        username = txtUsername.Text;
                        SecurityCode sc = new SecurityCode(txtUsername.Text);
                        sc.Show();
                        if (SecurityCode.passfail)
                        {
                            if (signin.AuthenticateUser(txtUsername.Text, txtPassword.Text))
                            {
                                UserSignin.username = txtUsername.Text;
                                this.Hide();
                            }
                            else
                            {
                                UserSignin.username = "";
                                MessageBox.Show("Invalid Username and Password", "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Invalid Username and Password", "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                    }
                }

                else
                {
                    if (signin.AuthenticateUser(txtUsername.Text, txtPassword.Text))
                    {
                        this.Hide();
                        MainMenu mm1 = new MainMenu();
                        mm1.Show();
                    }
                    else
                    {
                        MessageBox.Show("Invalid Username or Password", "Alert", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                    }
                }
            }
        }