Beispiel #1
0
 private void BtnGo_Click(object sender, EventArgs e)
 {
     if (TxtBoxUser.Text != "" && TxtBoxUser.Text != "" && TxtBoxUser.Text != "")
     {
         MySQLite mySQLite = new MySQLite(TxtBoxUser.Text, TxtBoxPwd1.Text, TxtBoxPwd2.Text);
         mySQLite.Pwdverification();
         mySQLite.OpenMySQL();
         mySQLite.InsertUName(out string ShowR);
         MessageBox.Show(ShowR);
     }
     else
     {
         MessageBox.Show("用户名或者密码无效!");
     }
 }
Beispiel #2
0
 private void BtnGo_Click(object sender, EventArgs e)
 {
     if (TxtBoxUser.Text != "" && TxtBoxPwd.Text != "")
     {
         MySQLite mySQLite = new MySQLite(TxtBoxUser.Text, TxtBoxPwd.Text);
         mySQLite.OpenMySQL();
         mySQLite.Queryfailure(out string ShowE);
         if (ShowE == "多次错误登录,程序终止!")
         {
             MessageBox.Show(ShowE);
             mySQLite.OpenMySQL();
             mySQLite.Resetcount();
             System.Environment.Exit(0);
         }
         else
         {
             mySQLite.OpenMySQL();
             mySQLite.QueryUName(out string ShowL);
             if (ShowL != "登录成功!")
             {
                 MessageBox.Show(ShowL);
                 mySQLite.OpenMySQL();
                 mySQLite.Failurecheck(out string ShowF);//查询User是否存在
                 if (ShowF == "User不存在")
                 {
                     MessageBox.Show("用户名或者密码错误!");
                 }
                 else
                 {
                     mySQLite.OpenMySQL();
                     mySQLite.Failurecount();//失败计数插入对应用户
                 }
             }
             else
             {
                 fmHome = new FmHome();
                 this.Hide();
                 fmHome.Show();
                 MessageBox.Show(ShowL);
             }
         }
     }
     else
     {
         MessageBox.Show("请输入用户名和密码!");
     }
 }