private void Form1_Load(object sender, EventArgs e) { cn = new Connectsql(); Func = new Functionplaygame(); rand = new Random(); img = Image.FromFile(Application.StartupPath + @"\chiecnon.png"); txtMang.Text = ""; groupBox2.Enabled = false; }
private void btdangnhap_Click(object sender, EventArgs e) { Functionplaygame Func = new Functionplaygame(); string tk = txtusername.Text.Trim(); string mk = txtpassword.Text.Trim(); if (Func.DangNhap(tk, mk)) { Formcauhoi frm = new Formcauhoi(); frm.Show(); this.Hide(); } else { if (tk == "" || mk == "") { MessageBox.Show("Bạn chưa nhâp tên đăng nhập hoặc mật khẩu"); } else { MessageBox.Show("Bạn Nhập sai tên đăng nhập hoặc mật khẩu"); } } }