Exemple #1
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Menu1 yeni = new Menu1();

            yeni.Show();
            this.Hide();
        }
Exemple #2
0
        private void btn_goBack_Click(object sender, EventArgs e)
        {
            Menu1 form = new Menu1();

            form.Show();
            form.FormClosing += (obj, args) => { this.Close(); };
            this.Hide();
        }
Exemple #3
0
 private void timer_Tick(object sender, EventArgs e)
 {
     Countdown.Text = countdwn.ToString();
     if (countdwn == 0)
     {
         if (Flag == true)
         {
             Menu1 form = new Menu1();
             form.Show();
             form.FormClosing += (obj, args) => { this.Close(); };
             this.Hide();
         }
     }
     countdwn--;
 }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            loginname = tBname.Text;
            // write o remember file
            if (cB1.Checked)
            {
                UserR.Username = tBname.Text;
                UserR.Password = tBpassword.Text;
                UserR.UserType = "1";

                var recordR = new user
                {
                    Username = tBname.Text,
                    Password = Functions.ComputeSha256Hash(tBpassword.Text),
                    UserType = "1"
                };

                recordsR.Add(recordR);
                using (var writer = new StreamWriter(Functions.bingPathToAppDir("\\data\\RememberMe.csv")))
                    using (var csv2 = new CsvWriter(writer, CultureInfo.InvariantCulture))
                    {
                        csv2.WriteRecords(recordsR);
                    }
            }
            for (int i = 0; i < Program.records.Count; i++)
            {
                if (Program.records[i].Username == tBname.Text)
                {
                    if (Program.records[i].Password == Functions.ComputeSha256Hash(tBpassword.Text))
                    {
                        Flag = true;
                        CurrentUser.Username = Program.records[i].Username;
                        CurrentUser.Password = Program.records[i].Password;
                        CurrentUser.UserType = Program.records[i].UserType;
                        break;
                    }
                }
            }
            if (newpassword == txtRegisterCode.Text)
            {
                Menu1 yeni = new Menu1();
                yeni.Show();
                this.Hide();

                for (int i = 0; i < Program.records.Count; i++)
                {
                    if (Program.records[i].Username == tBname.Text)
                    {
                        Program.records[i].Password = newpassword;
                    }
                }
            }
            if (Flag == true)
            {
                lbFlag.ForeColor  = System.Drawing.Color.Green;
                lbFlag.Text       = "Sucsesfull Login";
                btnLgn.Enabled    = false;
                btnSignup.Enabled = false;
                testc();
            }
            else
            {
                lbFlag.ForeColor = System.Drawing.Color.Red;
                lbFlag.Text      = "Failed To Login";
            }
        }