/// <summary> /// 鉴定并分析授权码字符窜。 /// </summary> /// <param name="autoString"></param> /// <returns></returns> public static AuthRightInfo AuthDataRight(string autoString) { string descStr = AuthDataEncrypt.DescryptHDString(autoString); if (descStr == null || descStr.Length < 16) { return(null); } string endDate = AuthDataEncrypt.ToDec(descStr.Substring(descStr.Length - 5, 5)).ToString(); descStr = descStr.Substring(0, descStr.Length - 5); string linkCount = AuthDataEncrypt.ToDec(descStr.Substring(descStr.Length - 5, 5)).ToString(); descStr = descStr.Substring(0, descStr.Length - 5); AuthRightInfo autoInfo = new AuthRightInfo(); autoInfo.EndDate = DateTime.FromOADate(double.Parse(endDate)); autoInfo.LinkCount = int.Parse(linkCount); autoInfo.HardDC = descStr; return(autoInfo); }
private void Form1_Load(object sender, System.EventArgs e) { _SerNumber = AuthDataEncrypt.GetHd(); txtSerNumber.Text = AuthDataEncrypt.EncryptHDString(_SerNumber); }