Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            int    id  = Convert.ToInt32(textBox1.Text.ToString());
            string sql = @"SELECT password FROM login WHERE id = {0};";

            sql = string.Format(sql, id);
            DataTable pw_table = DbOS.dataSet(sql).Tables[0];
            string    pw       = pw_table.Rows[0][0].ToString();
            string    tpw      = textBox3.Text.ToString();

            if (tpw == textBox4.Text.ToString())
            {
                if (pw == textBox2.Text.ToString())
                {
                    string com = @"UPDATE login SET password = '******' WHERE id ={1} ;";
                    com = string.Format(com, tpw, id);
                    DbOS.GetSqlcom(com);
                    MBox.Hint1("修改成功!");
                    this.Close();
                }
                else
                {
                    MBox.Warn("原始密码错误!");
                }
            }
            else
            {
                MBox.Warn("两次密码不匹配!");
            }
        }
Beispiel #2
0
 public bool logout()
 {
     if (MBox.Hint1("确定需要退出吗?"))
     {
         user.Dispose(); //退出账户时可以进行内存释放
         GC.Collect();   //强制回收内存
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #3
0
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     MBox.Hint1("请联系10086!");
 }