Ejemplo n.º 1
0
        private void buttonDes_Click(object sender, EventArgs e)
        {
            LicenceModel licenseModel = new LicenceModel(this.textBoxKey.Text, null);
            string       strDec       = licenseModel.Decrypt(this.richTextBox2.Text);

            this.richTextBox1.Text = strDec;
        }
Ejemplo n.º 2
0
 private void bt_readEndDate_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog openFile = new OpenFileDialog();
         openFile.Filter = ".lic|*.lic";
         if (openFile.ShowDialog() == DialogResult.OK)
         {
             LicenceModel licenceModelTemp = this.licenceModel.LoadLicence(openFile.FileName);
             string       endDate          = licenceModelTemp.Decrypt(licenceModelTemp.LicenceEndTime);
             DateTime     dt = DateTime.Parse(endDate);
             this.dateTimePicker1.Value = dt;
             this.textBoxTime.Text      = dt.ToString("HH:mm");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("读取授权文件失败!" + ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }