Exemple #1
0
        private void Button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainpage x = new mainpage();

            x.Show();
        }
Exemple #2
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Konto.namn = username.Text;
            Konto.pass = password.Text;


            char[] co = Konto.namn.ToCharArray();


            bool has1 = false;
            bool has2 = false;
            int  alf  = 0;


            for (int i = 0; i < co.Length; i++)
            {
                if (co[i] == '@')
                {
                    has1 = true;
                }

                if (co[i] == '.')
                {
                    has2 = true;
                }
                alf = alf + i;
            }
            if (has1 == true && has2 == true && Konto.pass != "" && alf >= 10)
            {
                this.Hide();
                mainpage x = new mainpage();
                x.Show();
            }
            else
            {
                SystemSounds.Beep.Play();
                MessageBox.Show("kontrollera din e-mail" + Environment.NewLine + "kontrollera din password" + Environment.NewLine + "Din e-mail måste inhålla minst 10 st string");
            }
        }