Esempio n. 1
0
 private void btn_NutDangNhap_Click(object sender, EventArgs e) // Kiểm Tra đăng nhập tại đây
 {
     if (this.tb_TenTaiKhoan.Text.Length != 0 && this.tb_MatKhau.Text.Length != 0)
     {
         try
         {
             MD5           md5hash      = MD5.Create();
             Registeration res          = new Registeration();
             string        passwordHash = res.GetMd5Hash(md5hash, this.tb_MatKhau.Text);
             ConnectData   connectData  = new ConnectData();
             if (connectData.CheckAccount(this.tb_TenTaiKhoan.Text, passwordHash) > 0)
             {
                 Form1 f = new Form1();
                 f.Show();
                 this.Visible = false;
             }
             else
             {
                 MessageBox.Show("Sai Mật Khẩu Hoặc Tài Khoản", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }catch (Exception)
         {
             MessageBox.Show("Lỗi Đường Truyền");
         }
     }
 }
Esempio n. 2
0
        private void btn_DiTrangDangKy_Click(object sender, EventArgs e)
        {
            Registeration re = new Registeration(); // Click vào nut btn_DiTrangDangKy_Click sẽ hiện Form Đăng Ký

            re.Show();
        }