You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|