微信幸运九宫格抽奖源码/51wsb_wxjgg/upwxuser.ashx.cs

(开头部分) 3KB

这里只显示每个文件的开头 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 wxjgg
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class upwxuser : IHttpHandler
    {

        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 username = context.Request["username"];
            int hdid = Convert.ToInt32(context.Request["hdid"]);
            string openid = context.Request.Cookies["9gg"]["openid"].ToString();
            string tel = context.Request["tel"];

            up_wxuser(hdid, openid, username, tel);
            context.Response.Write("{\"success\":\"true\",\"msg\":\"领取成功!\"}");
        }
        //修改粉丝信息
        public void up_wxuser(int hdid, string openid, string username, string tel)
        {
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["sqldb"].ToString());
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = "update jgg_wxuser set rename=@username,tel=@tel where hdid=@hdid and openid=@openid";
            cmd.Parameters.Add("@username", SqlDbType.NVarChar);
            cmd.Parameters.Add("@tel", SqlDbType.NVarChar);
            cmd.Parameters.Add("@hdid", SqlDbType.Int);
            cmd.Parameters.Add("@openid", SqlDbType.NVarChar);
            cmd.Parameters["@username"].Value = username;
            cmd.Parameters["@tel"].Value = tel;
            cmd.Parameters["@hdid"].Value = hdid;
            cmd.Parameters["@openid"].Value = openid;
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch
            {
                con.Close();
后面还有 39 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。