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("注册码不准确,请联系开发商!"); } }