using DevExpress.XtraEditors; using System; using System.Windows.Forms; using ZJ_BYD.Untils; namespace ZJ_BYD { public partial class MyActivave : XtraForm { public MyActivave() { InitializeComponent(); } private void btnActive_Click(object sender, EventArgs e) { var key = txtKeyCode.Text; if (string.IsNullOrWhiteSpace(key)) { XtraMessageBox.Show("激活码不能为空!"); return; } var sysTerm = DesHelper.DecryptStringFromBytes_Aes(key, "e8v7e6r5"); var parseResult = DateTime.TryParse(sysTerm, out _); if (!parseResult) { XtraMessageBox.Show("激活码格式有误,请重新输入!"); return; } var result = ExtendMethod.WriteValueByKey("ffff", key); if (result.isSuccess) { XtraMessageBox.Show($"{result.msg},请重新登录系统!"); this.DialogResult = DialogResult.OK; this.Dispose(); this.Close(); } else { XtraMessageBox.Show(result.msg); } } } }