private void _txtVaild_TextChanged(object sender, EventArgs e) { return; _txtExpiredDate.Text = string.Empty; ExpiredDatetime = DateTime.MinValue; var decodedString = string.Empty; try { decodedString = DesUtil.Decrypt(_txtVaild.Text); } catch { //do nothing } if (string.IsNullOrEmpty(decodedString)) { return; } try { if (VerificationConfig.GetSoftEndDateAllCpuId(1, decodedString) == VerificationConfig.GetCpuIdHashedString()) { //vaild cpuid ExpiredDatetime = DateTime.ParseExact(VerificationConfig.GetSoftEndDateAllCpuId(0, decodedString), "yyyyMMdd", CultureInfo.CurrentCulture, DateTimeStyles.None); _txtExpiredDate.Text = ExpiredDatetime.ToString("yyyy MMMM dd"); } } catch { //do nothing } }
public static string GetEncryptedSerialNumber(string yyyyMMddDate, string customCpuidHashedString = "") { return(DesUtil.Encrypt(GetSerialNumber(yyyyMMddDate, customCpuidHashedString))); }