摇一摇优惠券开源码/51wsb_weijuan/duijiang.ashx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace wxyaoyao
{
/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class duijiang : IHttpHandler
{
public double myRMB = 0;
public void ProcessRequest(HttpContext context)
{
//不让浏览器缓存
context.Response.Buffer = true;
context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
context.Response.AddHeader("pragma", "no-cache");
context.Response.AddHeader("cache-control", "");
context.Response.CacheControl = "no-cache";
context.Response.ContentType = "text/plain";
string password = context.Request["password"];
int hdid = Convert.ToInt32(context.Request["hdid"]);
string openid = context.Request["openid"];
int redid = Convert.ToInt32(context.Request["myyhqid"]);
string redpwd = redpwd_Reader(redid);
if (redpwd == password)
{
//兑奖操作
upmyRedbox(hdid, openid, redid);
context.Response.Write("{\"success\":\"true\",\"msg\":\"兑现成功!\",\"changed\":\"true\"}");
}
else
{
//密码不对
context.Response.Write("{\"success\":\"false\",\"msg\":\"商家密码不对\",\"changed\":\"false\"}");
}
}
public void upmyRedbox(int hdid, string openid, int redid)
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["sqldb"].ToString());
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "update myredlist set flage=1 where hdid=@hdid and openid=@openid and redid=@redid";
cmd.Parameters.Add("@hdid",SqlDbType.Int);
cmd.Parameters.Add("@openid",SqlDbType.NVarChar);
cmd.Parameters.Add("@redid",SqlDbType.Int);
cmd.Parameters["@hdid"].Value = hdid;
cmd.Parameters["@openid"].Value = openid;
cmd.Parameters["@redid"].Value = redid;
后面还有 67 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
