public VerifyStatusStruct verify([FromBody] VerifyStruct obj) { PaymentSelect select = new PaymentSelect(Configuration, _hostingEnvironment); return(select.Verify(obj)); }
public static void Activiate() { if (GlobalManager.RegInfo == null) { verifyInfo = new RegInfoValidated { IsExpire = true, IsValid = false, ED = DateTime.Now.AddDays(-1), Msg = "没有注册主体信息", MK = MachineKey }; return; } string licx2Directory = HttpContext.Current.Server.MapPath("~") + @"\..\licx2\"; string licx2Path = Path.Combine(licx2Directory, RegInfo.CP + '-' + RegInfo.PN + ".licx2"); bool licx2exist = win.core.utils.FileAdapter.Exists(licx2Path); if (!licx2exist) { licx2Path = Path.Combine(licx2Directory, "dev.licx2"); licx2exist = win.core.utils.FileAdapter.Exists(licx2Path); } if (!licx2exist) { licx2Directory = HttpContext.Current.Server.MapPath("~") + @"\..\..\licx2\"; licx2Path = Path.Combine(licx2Directory, RegInfo.CP + '-' + RegInfo.PN + ".licx2"); } licx2exist = win.core.utils.FileAdapter.Exists(licx2Path); if (!licx2exist) { licx2Path = Path.Combine(licx2Directory, "dev.licx2"); licx2exist = win.core.utils.FileAdapter.Exists(licx2Path); } if (!licx2exist) { verifyInfo = new RegInfoValidated { IsExpire = true, IsValid = false, ED = DateTime.Now.AddDays(-1), Msg = "没有licx2文件", MK = MachineKey }; return; } using (StreamReader sr = new StreamReader(licx2Path)) { string cryptoedString = sr.ReadToEnd(); VerifyStruct vs = ZPCrypto.Activiate(cryptoedString, RegInfo.CP, RegInfo.PN, (MachineHardwareType)RegInfo.MachineType, licx2Directory); verifyInfo = new RegInfoValidated { IsExpire = vs.Expired, IsValid = vs.Valid, ED = vs.ED, Msg = "", MK = MachineKey }; TimeSpan ts = vs.ED.Subtract(DateTime.Now); int days = ts.Days; if (days < 15) { if (days > 0) { verifyInfo.Msg = string.Format("系统即将在{0}天后过期,请联系管理员延长使用效期", days.ToString()); } else { verifyInfo.Msg = string.Format("系统即将在{0}小时{1}分后过期,请联系管理员延长使用效期", ts.Hours, ts.Minutes); } } if (vs.Valid && verifyInfo.Msg != "") { verifyInfo.needRemind = true; } } }