using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using DevExpress.XtraEditors; using System.Security.Cryptography; using System.IO; namespace Uninpho.Tools.components.SomethingSetting { public partial class InviteOfflineFrom : DevExpress.XtraEditors.XtraForm { public InviteOfflineFrom() { InitializeComponent(); } private void simpleButton1_Click(object sender, EventArgs e) { double n = 0; try { if (JHFXJCCcomboBoxEdit.Text == "期限授权") { n = Convert.ToDouble(dateText.Text.Trim()); } } catch { XtraMessageBox.Show("请填写正确的授权期限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (PubKey.Text == null) { XtraMessageBox.Show("请填写授权机器识别码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DateTime nowdtime = DateTime.Now.AddDays(Convert.ToDouble(dateText.Text)); string datestr = JHFXJCCcomboBoxEdit.Text == "期限授权" ? nowdtime.ToString() : "forever"; richTextBox1.Text = sqClass.Encrypt(PubKey.Text+ "灬" + datestr, UserInform.sqkey); } private void InviteOfflineFrom_Load(object sender, EventArgs e) { } private void JHFXJCCcomboBoxEdit_SelectedValueChanged(object sender, EventArgs e) { dateText.Visible = JHFXJCCcomboBoxEdit.Text == "期限授权"?true:false; } } }