Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form_Main fm = new Form_Main();

            Application.Run(fm);
            fm.Update_DataBase();
        }
Пример #2
0
 private void btn_Log_Click(object sender, EventArgs e)
 {
     if (txt_User.Text == "" || txt_Pass.Text == "")
     {
         label_Notify.Text = "Vui lòng nhập đầy đủ thông tin!";
     }
     else if (CheckUser() == 1)  // check user có tồn tại không. nếu có hàm CheckUser sẽ trả về 1.
     {
         label_Notify.Text      = "Tài khoản đã tồn tại.";
         label_Notify.ForeColor = Color.Red;
     }
     else
     {
         Register();
         Form_Main formmain = new Form_Main(txt_User.Text, txt_Email.Text);
         formmain.Show();
         //formmain.FormClosed += Logout;
         this.Hide();
     }
 }
Пример #3
0
 private void btn_Log_Click(object sender, EventArgs e)
 {
     if (txt_User.Text == "" || txt_Pass.Text == "")
     {
         label_Notify.Text = "Vui lòng nhập đầy đủ thông tin!";
     }
     else
     {
         if (Login(txt_User.Text, txt_Pass.Text) == true)
         {
             //Đăng Nhập Thành Công
             //phần code tiếp theo nếu đăng nhập thành công.
             Form_Main formmain = new Form_Main(player.Loginname, player.Email);
             formmain.Show();
             //formmain.FormClosed += Logout;
             this.Hide();
         }
         else
         {
             label_Notify.Text = "Tài khoản hoặc mật khẩu không đúng";
         }
     }
 }