/// <summary> /// 验证车牌 /// </summary> /// <param name="context"></param> public void VerifyLicensePlate(HttpContext context) { var cph = context.Request.Params["cph"].ToString().Replace(",", ";"); string logid = context.Request.Params["logid"]; string token = DESEncrypt(userid, "tms&sgt#"); string param = "userId=" + userid + "&token=" + token + "&vnos=" + HttpUtility.UrlEncode(cph, Encoding.UTF8); string ret = PostWebRequest(url, param, Encoding.UTF8); MapResponseData mapRes = JsonConvert.DeserializeObject <MapResponseData>(ret); if (mapRes.code == "0" || mapRes.code == "3") { res.result = true; res.data = param; if (mapRes.code == "3") { res.msg = "只找到部分车的定位信息:" + mapRes.result; res.data = "userId=" + userid + "&token=" + token + "&vnos=" + HttpUtility.UrlEncode(mapRes.result.Replace(",", ";").TrimEnd(';'), Encoding.UTF8); } if (string.IsNullOrEmpty(logid)) { Interfaces.Service.MapService serv = new Interfaces.Service.MapService(); serv.InsertMapLog(userid, token, cph, res.msg); } } else if (mapRes.code == "1" || mapRes.code == "2") { res.result = false; res.msg = mapRes.des; } }
public void PdcphVerifyLicensePlate(HttpContext context) { var cph = context.Request.Params["cph"].ToString().Replace(",", ";"); string logid = context.Request.Params["logid"]; string token = HttpUtility.UrlEncode(DESEncrypt(userid, "tms&sgt#")); string param = "userId=" + userid + "&token=" + token + "&vno=" + HttpUtility.UrlEncode(cph, Encoding.UTF8); string ret = PostWebRequest(url_yzcph, param, Encoding.UTF8); MapResponseData mapRes = new MapResponseData(); mapRes = JsonConvert.DeserializeObject <MapResponseData>(ret); if (mapRes.code == "0") { res.result = true; } else { res.result = false; } }