Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)//确认修改密码
 {
     temp = Global.con.ConnectionString;
     //data source=G:\NAMEIT2.mdb;provider=Microsoft.Jet.OLEDB.4.0;mode=12;Jet OleDb:DataBase Password=123
     OldPWD = temp.Substring(temp.IndexOf("Password") + "Password".Length + 1);//包括“=”占用的
     NewPWD = textBox2.Text;
     if (textBox1.Text == OldPWD)
     {
         M.AlterDBPWD(OldPWD == "" ? "null" : OldPWD, NewPWD == "" ? "null" : NewPWD);//是空密码则切换为null
     }
     else
     {
         MyDialog.Msg("验证失败。", 3);
         textBox1.Text = "";
         textBox1.Focus();
         return;
     }
     MyDialog.Msg("密码已更新!即将重新登录。", 1);
     CentralForm.Logout();
 }