public IActionResult RedirectToApplyPage(string idNumber, string isLocal) { ResultData <string> result = new ResultData <string>(); if (idNumber.Length != 18) { result.Status = ResultStauts.Error; result.Msg = "身份证号输入错误,不足18位!"; } else { if (RegularHelper.CheckIdNumber18(idNumber)) { IdNumber id = new IdNumber(idNumber); #region 与规定报名年限不符 if (Convert.ToDateTime(id.BirthDay) == DateTime.Now) { result.Status = ResultStauts.Error; result.Msg = "您的年龄与规定报名年限不符!如有疑问,请联系长春市教育局!"; } #endregion else { result.Status = ResultStauts.Success; result.Data = $"/Apply/ApplyPage?idNumber={DESEncryptHelper.DesEncrypt(idNumber)}&isLocal={DESEncryptHelper.DesEncrypt(isLocal)}"; } } else { result.Status = ResultStauts.Error; result.Msg = "身份证号错误,请核实!"; } } return(Json(result)); }
public static void StartTest() { string content = "你a#12"; string key = "aabbfdhr"; string s1 = DESEncryptHelper.DesEncrypt(content, key); string s2 = DESEncryptHelper.DesDecrypt(s1, key); if (s2.Equals(content)) { System.Console.WriteLine("DES加密解密通过"); } string s3 = DESEncryptHelper.DesEncrypt(content); string s4 = DESEncryptHelper.DesDecrypt(s3); if (s4.Equals(content)) { System.Console.WriteLine("DES加密解密通过"); } }