using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Learun.Util; namespace Quanjiang.DigitalScholl.License { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void btgenerate_Click(object sender, EventArgs e) { StringBuilder machinelic =new StringBuilder(); if (tbmachine.Text!="") { machinelic.Append(Md5Helper.Encrypt(tbmachine.Text,16)); machinelic.Append("&"); if (cbenabledtp.Checked) { machinelic.Append(dtpenddate.Value.ToString("yyyy-MM-dd")); } string desstr = DESEncrypt.Encrypt(machinelic.ToString(), "bjquanjiang@2020!@lckey" + Md5Helper.Encrypt(tbmachine.Text, 32)); tblicensecode.Text = desstr; } else { MessageBox.Show("请填写机器码"); } } } }