Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string userNameText = textBox1.Text;
            string passwordText = textBox2.Text;
            string gmailText    = textBox3.Text;

            if (userNameText == "" || passwordText == "" || gmailText == "")
            {
                warning.Visible = true;
                Success.Visible = false;
            }
            else
            {
                if (userNameText.Length < 25)
                {
                    warning.Visible = false;
                    Success.Visible = true;
                    string encpass = Aescryp.Encrypt(passwordText);
                    if (Register(userNameText, encpass, gmailText))
                    {
                        MessageBox.Show($"User {userNameText} has been created");
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show($"User not created!");
                    }
                }
                else
                {
                    MessageBox.Show("Username too long!");
                }
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            user = bunifuCustomTextbox1.Text;
            string pass = bunifuCustomTextbox2.Text;

            pass = Aescryp.Encrypt(pass);
            if (IsLogin(user, pass))
            {
                incorrectLabel.Visible = false;
                homepage.Show();
                wplayer.controls.stop();
                this.Hide();
            }
            else
            {
                incorrectLabel.Visible = true;
            }
        }