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

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace wxjgg
{
    public partial class share : System.Web.UI.Page
    {
        public int hdid = 0;
        public string openid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                hdid = Convert.ToInt32(Request.QueryString["hdid"]);
                if (Request.Cookies["9gg"] != null)
                {
                    openid = Request.Cookies["9gg"]["openid"].ToString();
                    //分享+1次抽奖
                    updateOPenid();
                    Response.Redirect("/index.aspx?hdid=" + hdid.ToString());
                }
                else
                {
                    Response.Redirect(Gzurl());
                }
            }
        }

        public void updateOPenid()
        {
            string sharetime = DateTime.Now.ToString("yyyy-MM-dd");
            SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["sqldb"].ToString());
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandText = "update jgg_wxuser set cjcount=cjcount+1,sharetime=@sharetime where openid=@openid and hdid=@hdid and sharetime<>@sharetime";
            cmd.Parameters.Add("@sharetime", SqlDbType.NVarChar);
            cmd.Parameters.Add("@openid", SqlDbType.NVarChar);
            cmd.Parameters.Add("@hdid", SqlDbType.Int);
            cmd.Parameters["@sharetime"].Value = sharetime;
            cmd.Parameters["@openid"].Value = openid;
            cmd.Parameters["@hdid"].Value = hdid;
            try
            {
                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch
            {
                con.Close();
后面还有 27 行代码,购买后查看完整代码

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

AI 解读 AI

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

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