Esempio n. 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == string.Empty)
     {
         MessageBox.Show(@"新密码不能为空!");
         return;
     }
     try
     {
         Init(out var err);
         if (err != string.Empty)
         {
             MessageBox.Show(err);
         }
         else
         {
             if (ChangePwd(textBox1.Text))
             {
                 MessageBox.Show(@"密码修改成功!");
             }
             YxLog.Info($@"修改数据库密码为:{textBox1.Text}");
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
         YxLog.Error(exception);
     }
 }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Init(out var err); if (err != string.Empty)
         {
             MessageBox.Show(err);
         }
         else
         {
             if (!ChangePwd())
             {
                 return;
             }
             MessageBox.Show(@"密码删除成功!");
             YxLog.Info(@"数据库密码删除成功");
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
         YxLog.Error(exception);
     }
 }