摇一摇优惠券开源码/51wsb_weijuan/saveuser.ashx.cs

(开头部分) 2KB

这里只显示每个文件的开头 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 saveuser : 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";
            int hdid = Convert.ToInt32(context.Request["hdid"]);
            string openid=context.Request["openid"];
            string name = context.Request["name"];
            string tel = context.Request["tel"];

            bool flage=adduser( hdid, openid, name , tel);
            if (flage == true)
            {
                context.Response.Write("信息提交成功!");
            }
            else
            {
                context.Response.Write("信息提交失败,请重新提交试试!");
            }
        }


        public bool adduser(int hdid,string openid,string name ,string tel)
        {
            bool flage = false;
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["sqldb"].ToString());
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = "update wxyaoyao_wxuser set rename=@name,tel=@tel where openid=@openid and hdid=@hdid";
            cmd.Parameters.Add("@name",SqlDbType.NVarChar);
            cmd.Parameters.Add("@tel",SqlDbType.NVarChar);
            cmd.Parameters.Add("@openid",SqlDbType.NVarChar);
            cmd.Parameters.Add("@hdid",SqlDbType.Int);

            cmd.Parameters["@name"].Value = name;
            cmd.Parameters["@tel"].Value = tel;
            cmd.Parameters["@openid"].Value = openid;
后面还有 25 行代码,购买后查看完整代码

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

AI 解读 AI

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

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