private void Button_注册_Click(object sender, RoutedEventArgs e)
        {
            string        registerCode = TextBox_注册.Text.Trim().ToUpper();
            UsbController usb          = new Helper.Tools.UsbController();
            string        date         = DateTime.Now.ToString("yyyyMMdd");
            string        orginCode    = "StoneAnt.PA" + date + usb.getSerialNumberFromDriveLetter();
            string        validateCode = Secure.GetMD5_32(orginCode).ToUpper();

            if (registerCode.Equals(validateCode))
            {
                rg.UpdateSoftwareVersionStatus((int)ENUM.EM_SOFTWARESTATE.已注册);
                rg.UpdateSoftwareRegisterCode(registerCode);
                //注册后加密数据库
                DBInitialize.ChangeDBPassword();
                xw.WriteXML("注册", "true");

                MessageBoxCommon.Show("注册成功!");
                this.LoadPage();
                Grid_Register.Visibility = Visibility.Collapsed;
            }
            else
            {
                MessageBoxCommon.Show("注册码不准确,请联系开发商!");
            }
        }
 private void Button_解密_Click(object sender, RoutedEventArgs e)
 {
     DBInitialize.ClearPassword();
     File.Copy(DBInitialize.dataSource, "Data\\DataWithoutPassword.db", true);
     new XMLWriter().WriteXML("注册", "false");
     DBInitialize.ChangeDBPassword();
     new XMLWriter().WriteXML("注册", "true");
     Log.Write("成功拷贝机密文件");
     MessageBoxCommon.Show("拷贝成功!");
 }