public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string result = ""; try { string tel = context.Request.QueryString["tel"].ToString(); string oid = context.Request.QueryString["oid"].ToString(); //string yyid = context.Request.QueryString["yyid"].ToString(); //string time = context.Request.QueryString["time"].ToString(); //string imgyzm = context.Request.QueryString["imgyzm"].ToString(); int userid = 0; string yyid = "27143"; string time = "3"; if (context.Request.Cookies["AdminInfo"] != null) { HttpCookie cookie = Cookie.Get("AdminInfo"); //用户输入 了电话和地址 记录最新 userid = (cookie.Values["AdminId"]).ToInt(); } else { result = "-2"; return; } if (string.IsNullOrEmpty(oid)) { result = "-2"; return; } //判断产品是否符合要求 var order = new Dal.Db.OrderDal().GetAll("*", "userid=" + userid + " and status=0 and id=" + oid, null, ""); if (order == null || order.Count == 0) { result = "-2"; return; } //判断图形验证码是否正确 //if (context.Request.Cookies["banana_shop_imgyzm"] != null) //{ // HttpCookie cookie1 = Cookie.Get("banana_shop_imgyzm"); //if (cookie1.Values["imgyzm"] == imgyzm) //{ Random r = new Random(); int y = r.Next(1000, 9999); if (context.Request.Cookies["banana_shop_yzm" + oid] == null) { HttpCookie cookie = new HttpCookie("banana_shop_yzm" + oid); cookie.Values.Add("yzm", y.ToString()); //设定此cookies值 //设定cookie的生命周期 cookie.Expires = DateTime.Now.AddMinutes(Convert.ToInt32(time)); //加入此cookie context.Response.AppendCookie(cookie); result = sendYzm(tel, yyid, new string[] { y.ToString(), time }); } else { result = "-2"; } //} //else //{ // result = "-3"; //} //} //else //{ // result = "-3"; //} } catch { result = "-1"; } context.Response.Write(result); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string result = ""; try { string tel = context.Request.QueryString["tel"].ToString(); string oid = context.Request.QueryString["oid"].ToString(); //string yyid = context.Request.QueryString["yyid"].ToString(); //string time = context.Request.QueryString["time"].ToString(); //string imgyzm = context.Request.QueryString["imgyzm"].ToString(); int userid = 0; string yyid = "27143"; string time = "3"; if (context.Request.Cookies["AdminInfo"] != null) { HttpCookie cookie = Cookie.Get("AdminInfo"); //用户输入 了电话和地址 记录最新 userid = (cookie.Values["AdminId"]).ToInt(); } else { result = "-2"; return; } if (string.IsNullOrEmpty(oid)) { result = "-2"; return; } //判断产品是否符合要求 var order = new Dal.Db.OrderDal().GetAll("*", "userid=" + userid + " and status=0 and id=" + oid, null, ""); if (order == null || order.Count == 0) { result = "-2"; return; } //判断图形验证码是否正确 //if (context.Request.Cookies["banana_shop_imgyzm"] != null) //{ // HttpCookie cookie1 = Cookie.Get("banana_shop_imgyzm"); //if (cookie1.Values["imgyzm"] == imgyzm) //{ Random r = new Random(); int y = r.Next(1000, 9999); if (context.Request.Cookies["banana_shop_yzm" + oid] == null) { HttpCookie cookie = new HttpCookie("banana_shop_yzm" + oid); cookie.Values.Add("yzm", y.ToString()); //设定此cookies值 //设定cookie的生命周期 cookie.Expires = DateTime.Now.AddMinutes(Convert.ToInt32(time)); //加入此cookie context.Response.AppendCookie(cookie); result = sendYzm(tel, yyid, new string[] { y.ToString(), time }); } else { result = "-2"; } //} //else //{ // result = "-3"; //} //} //else //{ // result = "-3"; //} } catch { result = "-1"; } context.Response.Write(result); }