private void SetText(T_Base nowRow) { Empty(); if (nowRow != null) { txtBH.txt.Text = nowRow.bianhao; txtXM.txt.Text = nowRow.itemName; txtMK.txt.Text = UserProc.DecryptDES(nowRow.item0, "12345678"); lblTxt4.txt.Text = nowRow.item1; lblTxt5.txt.Text = nowRow.beizhu; } }
private void buttonX1_Click(object sender, EventArgs e) { string value = DateTime.Now.ToString("yy-mm-dd hh").Replace("-", "").Replace(" ", ""); string sad = UserProc.DecryptDES(textBox2.Text, value); Console.WriteLine(sad); if (sad.Contains(textBox1.Text)) { Settings.Default.rtime = DateTime.Now.ToString("yy-MM-dd hh:mm:ss"); DialogResult = DialogResult.Yes; Settings.Default.rKey = "已注册"; Settings.Default.dqtime = sad.Split(',')[1]; if (!Settings.Default.dqtime.Contains("永久")) { MessageBox.Show("注册成功,有效期:" + Settings.Default.dqtime + "天"); } else { MessageBox.Show("注册成功,有效期:" + Settings.Default.dqtime); } Settings.Default.Save(); } else { MessageBox.Show("注册码有效期为当天,请检查注册码"); } if (!Settings.Default.dqtime.Contains("永久")) { int asd = int.Parse(Settings.Default.dqtime); if (Settings.Default.rtime.CompareTo(DateTime.Now.AddDays(-asd).ToString("yy-MM-dd hh:mm:ss")) < 0) { MessageBox.Show("注册码到期,请重新获取注册码"); Settings.Default.rKey = ""; Settings.Default.Save(); return; } } }