コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string author = Request["p"];

            if (author == null || author.Equals(""))
            {
                author = UserTool.GetAccount(Session); // 获取登录的用户名
            }

            if (author != null && !author.Equals(""))
            {
                // 查询收益信息
                string url    = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/UserWithdraw.aspx" + "?" + "TYPE=Reward&author=" + author;
                string reward = ScTool.getWebData(url);

                LabelAccount.Text = author;
                LabelReward.Text  = reward;

                DataBase DB_Ali = new DataBase(ScTool.DBName(ScTool.PayTypeAli), ScTool.UserName, ScTool.Password);
                showTable(DivTable.Controls, DB_Ali, ScTool.ORDER, author, "True");

                showTable(DivTableHistory.Controls, DB_Ali, ScTool.ORDER, author, "TrueFinish");
            }
            else
            {
                LabelAccount.Text = "";
                LabelReward.Text  = "0";

                DivTable.InnerText = "示例:" + "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/UserRewards.aspx" + "?" + "p=scimence";
            }
        }
コード例 #2
0
ファイル: HB_pre.aspx.cs プロジェクト: scimence/QrPaySystem
        /// <summary>
        /// 从信息表中获取数据
        /// </summary>
        /// <param name="ID"></param>
        /// <param name="keyName"></param>
        /// <returns></returns>
        private string getHbInfo(string ID, string keyName)
        {
            string commond = "TYPE=Get&ID=" + ID + "&KeyName=" + keyName;
            string url     = InfoUrl + "?" + commond;
            string value   = ScTool.getWebData(url);

            return(value);
        }
コード例 #3
0
ファイル: Product.aspx.cs プロジェクト: scimence/QrPaySystem
        protected void ImageButton_Create_Click(object sender, ImageClickEventArgs e)
        {
            //Session[key] = TextBox_Account.Text.Trim(); // 账号变动时,记录账号信息至Session

            string account = TextBox_Account.Text.Trim();   // 用户账号
            string name    = TextBox_Name.Text.Trim();      // 资源名称
            string price   = TextBox_Price.Text.Trim();     // 价格

            if (price.EndsWith("元"))
            {
                price = price.Replace("元", "");
            }

            string pass = TextBox_Pass.Text.Trim();         // 密码

            // 记录信息至Product表,返回记录id
            string commond = "TYPE=Add&name=" + name + "&price=" + price + "&author=" + account + "&data=" + pass + "&ext=";
            string url     = HostUrl + "/Pages/ProductInfo.aspx" + "?" + commond;
            string Id      = ScTool.getWebData(url);

            if (Id.Equals(""))
            {
                Label_tip.Text = "资源二维码制作失败! -> Id为空";
                return;
            }

            // 制作收款码
            //string link = HostUrl + "/Pages/Product.aspx" + "?" + "p=" + Id;
            string link = "http://scimence.gitee.io/url/product.html" + "?" + "p=" + Id;    // 使用静态页地址进行转发

            if (UseStaticIpMode)
            {
                link = HostUrl + "/Pages/Product.aspx" + "?" + "p=" + Id;                   // 使用当前静态ip地址
            }
            string picName = Product_QrTool.genPayPic(link, name, Id, "tools\\QRTool\\QR_Product\\");

            if (!picName.Equals(""))
            {
                img_Example.Src = "~/tools/QRTool/QR_Product/" + picName;           // 显示生成的二维码
                Label_tip.Text  = "资源二维码已生成!";

                string picUrl = HostUrl + "/tools/QRTool/QR_Product/" + picName;
                ShowDownload(picUrl);

                //if (!account.Equals("")) Session[key] = account;    // 记录账号信息至Session
            }
            else
            {
                Label_tip.Text    = "二维码制作失败!";
                DivSave.InnerHtml = "";
            }
        }
コード例 #4
0
        //-------------------------------------------

        /// <summary>
        /// 从资源信息创建预下单号
        /// </summary>
        private string CreateOrder(string resId, string name, string price, string author)
        {
            // 从网页接口Sql.aspx获取数据
            string commond = "TYPE=PreOrder&machinCode=ProductInfo" + resId + "&soft=付费资源&product=" + name + "&money=" + price + "&ext=author(" + author + ")author;";

            string InfoUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/Pay.aspx";
            String url     = InfoUrl + "?" + commond;
            string Id      = ScTool.getWebData(url); // Result(100)Result

            Id = getNodeData(Id, "Result");

            return(Id);
        }
コード例 #5
0
        protected void ButtonClear_Click(object sender, EventArgs e)
        {
            string author = TextBox_Account2.Text.Trim();

            if (!author.Equals(""))
            {
                string url    = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/UserWithdraw.aspx" + "?" + "TYPE=RewardClear&author=" + author;
                string reward = ScTool.getWebData(url);

                //ScTool.showTable(DivTable.Controls, DB, UserWithdraw.TAB);
                showTable();

                Label_tip.Text = "用户" + author + "已发放,当前收益已清空!";
            }
        }
コード例 #6
0
        /// <summary>
        /// 在预下单中,查询订单是否成功
        /// </summary>
        private bool OrderSuccess(string preOrderId)
        {
            string commond = "TYPE=OrderResultX&preOrderId=" + preOrderId;
            string InfoUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/Pay.aspx";
            String url     = InfoUrl + "?" + commond;

            string data = ScTool.getWebData(url);

            if (data.Contains("Result(true)Result"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #7
0
ファイル: HB_pre.aspx.cs プロジェクト: scimence/QrPaySystem
        protected void Button1_Click(object sender, EventArgs e)
        {
            string QrUrl  = TextBox1.Text.Trim();
            string HbUrl  = TextBox2.Text.Trim();
            string Tittle = TextBox3.Text.Trim();


            // 从网页接口Sql.aspx获取数据
            string commond = "TYPE=Add&QrUrl=" + QrUrl + "&HbUrl=" + HbUrl + "&Tittle=" + Tittle + "&ext=";

            String url = InfoUrl + "?" + commond;
            string Id  = ScTool.getWebData(url);

            String PageUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + this.GetType().Name.Replace("_", "/").Replace("/aspx", ".aspx");

            HyperLink1.NavigateUrl = PageUrl + "?" + "p=" + Id;
            HyperLink1.Text        = "红包收款码:" + HyperLink1.NavigateUrl;
        }
コード例 #8
0
        /// <summary>
        /// 判断指定的machinCode/soft是否已完成支付
        /// </summary>
        private bool IsPayed_Web(string machinCode, string soft = null)
        {
            if (machinCode == null || machinCode.Equals(""))
            {
                return(false);
            }

            // TYPE=OrderResultX&machinCode=机器码1&soft=可为空
            if (soft == null)
            {
                soft = "";
            }
            string payUrl  = host + "Pages/Pay.aspx";
            string commond = "TYPE=OrderResultX&machinCode=" + machinCode + "&soft=" + soft;
            string url     = payUrl + "?" + commond;
            string value   = ScTool.getWebData(url);

            return(value.Contains("(success)"));
        }
コード例 #9
0
        /// <summary>
        /// 创建待支付订单
        /// </summary>
        private string CreatePreOrder(string machinCode, string soft = null)
        {
            if (machinCode == null || machinCode.Equals(""))
            {
                return(url);
            }

            if (soft == null)
            {
                soft = "";
            }
            string payUrl = host + "Pages/Pay.aspx";
            string param  = QrPaySystem.Pages.Pay.PayParams(machinCode, soft, "5.00", null, "支付宝用户id接口");
            string urlP   = payUrl + "?" + "TYPE=PreOrder&" + param;

            string Id = ScTool.getWebData(urlP);   // 创建订单

            Id = ScTool.getNodeData(Id, "Result"); // Result(100)Result

            return(Id);
        }
コード例 #10
0
        /// <summary>
        /// 当订单支付成功时(若当前订单对应)
        /// </summary>
        private void CheckShow_ProductData(DataBase DB, string orderId)
        {
            Dictionary <string, string> Dic = DB.SelectValue(ScTool.ORDER, orderId, "ID").RowDic();

            if (Dic.Count > 0 && Dic.ContainsKey("param") && Dic.ContainsKey("isSuccess"))
            {
                bool isSuccess = Dic["isSuccess"].Trim().ToLower().Equals("true");
                if (isSuccess)
                {
                    //Response.Write(ScTool.Alert("isSuccess"));

                    string param = Dic["param"].Trim();                     // machinCode=ProductInfo100&soft=付费资源&product=资源xx测试&money=0.10&ext=author(scimence)author;
                    string strS  = "machinCode=ProductInfo";

                    if (param.StartsWith(strS) && param.Contains("&"))      // 以该字段开头则为付费资源,ProductInfo.aspx -> CreateOrder
                    {
                        int    start = param.IndexOf(strS) + strS.Length;
                        int    end   = param.IndexOf("&", start);
                        string resId = param.Substring(start, end - start).Trim();   // 获取对应的资源id

                        //Response.Write(ScTool.Alert("resId -> " + resId));

                        // 查询对应的资源数据
                        string InfoUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/Productinfo.aspx";
                        String url     = InfoUrl + "?" + "TYPE=Select&ID=" + resId + "&key=data";
                        string data    = ScTool.getWebData(url);  // Result(100)Result

                        LabelTipInfo.Text = data;

                        //Response.Write(ScTool.Alert(data));

                        // 展示资源对应数据
                        //ShowInfo(data);
                    }
                }
            }
        }
コード例 #11
0
        protected void ButtonRefresh_Click(object sender, EventArgs e)
        {
            string author = TextBox_Account1.Text.Trim();

            if (author.Equals(""))
            {
                author = "ALL";
            }

            string url    = "http://" + Request.Params.Get("HTTP_HOST") + "/Pages/UserWithdraw.aspx" + "?" + "TYPE=Reward&author=" + author;
            string reward = ScTool.getWebData(url);

            //ScTool.showTable(DivTable.Controls, DB, UserWithdraw.TAB);
            showTable();

            if (author.Equals("ALL"))
            {
                Label_tip.Text = "所有用户" + ",当前收益" + reward;
            }
            else
            {
                Label_tip.Text = "用户" + author + ",当前收益" + reward;
            }
        }
コード例 #12
0
ファイル: HbPay2.aspx.cs プロジェクト: scimence/QrPaySystem
        string Tittle    = "";  // 商户名称

        //Boolean testMode = false;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ScTool.RecordUserAgent(Request);                      // 记录客户端信息
            }
            //FileUpload_HB.Style.Add("display", "none");   // 隐藏控件
            Body1.Style.Add("display", "none");   // 隐藏body
            //BtnDiv.Style.Add("display", "none");   // 隐藏按钮
            BtnDiv.Style.Add("display", "none");  // 隐藏按钮

            //Request.Params[HTTP_HOST]:60.205.185.168:8001
            //Request.Url:http://60.205.185.168:8001/Pages/request.aspx
            //string ServerUrl = "http://" + Request.Params["HTTP_HOST"];

            QrUrl  = Request["QrUrl"];  // 当前打开
            HbUrl  = Request["HbUrl"];  // 跳转至
            Tittle = Request["Tittle"]; //

            if (QrUrl == null)
            {
                QrUrl = "";
            }
            //if (testMode)
            //{
            //    if (QrUrl == null) QrUrl = "https://www.baidu.com";
            //    if (HbUrl == null) HbUrl = "https://fanyi.baidu.com"; // 默认红包码
            //}
            //else
            //{
            //if (QrUrl == null) QrUrl = "https://qr.alipay.com/tsx031041ajtuiviwd978b6";
            if (HbUrl == null)
            {
                HbUrl = "https://qr.alipay.com/c1x01990gbhjvuvwaxwkqa3";                // 默认红包码
            }
            //}

            if (Tittle == null)
            {
                Tittle = "商户名称(未设置)";
            }
            if (QrUrl.StartsWith("ShowInfo_"))
            {
                QrUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + "PageHB/ShowInfo.aspx?p=" + QrUrl.Substring("ShowInfo_".Length);
            }


            if (QrUrl.Equals(""))
            {
                string msg = "参数QrUrl不应为空!";
                msg += "\r\n示例:" + Request.Url + "?" + "QrUrl=" + "http://www.baidu.com" + "&HbUrl=" + "" + "&Tittle=" + "第8号当铺";

                Response.Write(ScTool.Alert(msg));
                return;
            }

            LabelTittle.Text = Tittle;

            string key  = "HbPay2";
            string date = DateTime.Now.ToString("yyyyMMdd");        // 每天可领取一次,首次跳转


            if (Session.Timeout != 60 * 24)
            {
                Session.Timeout = 60 * 24;                               // 设置Session有效时间为24小时
            }
            string value = "";

            if (Session[key] == null || !(Session[key] as string).StartsWith(date))  // 若key不存在,或非今天的则生成新的值
            {
                value        = date + "_0";
                Session[key] = value;
            }

            if ((Session[key] as string).Equals(date + "_0"))       // 打开收款码
            {
                Session[key] = date + "_1";
                //if (testMode)
                //{
                //    BtnDiv.InnerHtml = "<a id=\"BtnName1\"  target=\"_blank\" " + " onclick=\"reloadPage()\" " + " href=\"" + QrUrl + "\" " + "><img src=\"../tools/HB_pic/btn.png\"></a>";
                //}
                //else
                //{
                //BtnDiv.InnerHtml = "<a id=\"BtnName1\" " + " onclick=\"reloadPage()\" " + " href=\"" + "alipayqr://platformapi/startapp?saId=10000007&qrcode=" + QrUrl + "\" " + "><img src=\"../tools/HB_pic/btn.png\"></a>";
                BtnDiv.InnerHtml = "<a id=\"BtnName1\" " + " onclick=\"reloadPage()\" " + " href=\"" + "alipayqr://platformapi/startapp?saId=10000007&qrcode=" + QrUrl + "\" " + "> </a>";
                //}
            }
            else if ((Session[key] as string).Equals(date + "_1"))  // 重定向至红包码
            {
                // 红包首次访问计数
                if (Request["ID"] != null)
                {
                    string InfoUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/PageHB/HbInfo.aspx";
                    string commond = InfoUrl + "?" + "TYPE=CountAdd&ID=" + Request["ID"];
                    ScTool.getWebData(commond);
                }

                Session[key] = date + "_2";
                Response.Redirect(HbUrl);

                // 若要回到红包页面
                //BtnDiv.InnerHtml = "<a id=\"BtnName1\" href=\"" + HbUrl + "\"><img src=\"../tools/HB_pic/btn.png\"></a>";
            }
            else
            //if ((Session[key] as string).Equals(date + "_2"))
            {
                //Response.Redirect(QrUrl);
                Session[key] = date + "_3";
                //Response.Redirect("alipayqr://platformapi/startapp?saId=10000007&qrcode=" + QrUrl);
                Response.Redirect(QrUrl);
                //BtnDiv.InnerHtml = "<a id=\"BtnName1\" " + " href=\"" + QrUrl + "\"><img src=\"../tools/HB_pic/btn.png\"></a>"; //直接链接收款码,返回会关闭页面
                //BtnDiv.InnerHtml = "<a id=\"BtnName1\" " + " href=\"" + "alipayqr://platformapi/startapp?saId=10000007&qrcode=" + QrUrl + "\"><img src=\"../tools/HB_pic/btn.png\"></a>";
            }
            //else if ((Session[key] as string).Equals(date + "_3"))
            //{
            //    Session[key] = date + "_2";
            //    BtnDiv.InnerHtml = "<a id=\"BtnName3\" " + " href=\"" + "alipayqr://platformapi/startapp?saId=10000007&qrcode=" + QrUrl + "\"><img src=\"../tools/HB_pic/btn.png\"></a>";
            //}

            //String Re = "http://" + Request.Params.Get("HTTP_HOST") + "/PageHB/Redirect.aspx";
            //String Hb = "http://" + Request.Params.Get("HTTP_HOST") + "/PageHB/HB.aspx";
            //String mackUrl = Re + "?p=" + Hb;
            //LinkDiv.InnerHtml = "<a href=\"" + mackUrl + "\"><asp:Label Text=\"制作我的红包收款码\" ForeColor=\"White\"></asp:Label></a>";
        }
コード例 #13
0
        /// <summary>
        /// 记录红包码、二维码、商家名称,返回记录id,生成新的红包收款码供商家收款
        /// </summary>
        /// <param name="e"></param>
        protected void ImageButton_Create_Click(object sender, ImageClickEventArgs e)
        {
            string QrUrl  = TextBox_SK.Text.Trim();     // 收款码
            string HbUrl  = TextBox_HB.Text.Trim();     // 红包码
            string Tittle = TextBox_Tittle.Text.Trim(); // 商家名称

            if (HbUrl.Equals("") || HbUrl.Contains("红包码") || HbUrl.StartsWith("Error:"))
            {
                Label_tip.Text = "请先点击,添加您的红包码!";
                return;
            }
            if (QrUrl.Equals("") || QrUrl.Contains("收款码") || QrUrl.StartsWith("Error:"))
            {
                Label_tip.Text = "请先点击,添加您的收款码!";
                return;
            }
            if (Tittle.Equals("") || Tittle.Contains("第8号当铺"))
            {
                Label_tip.Text = "请添加您的商家名称!";
                return;
            }

            // 红包码,收款码 数据校验
            if (!ChekQrTrue(ref QrUrl, ref HbUrl))
            {
                //Label_tip.Text = "红包码或收款码上传错误,请重新上传!";
                return;
            }

            // 记录红包码、收款码信息,返回记录id
            string commond = "TYPE=Add&QrUrl=" + QrUrl + "&HbUrl=" + HbUrl + "&Tittle=" + Tittle + "&ext=";

            string url = InfoUrl + "?" + commond;
            string Id  = ScTool.getWebData(url);

            if (Id.Equals(""))
            {
                Label_tip.Text = "红包收款码制作失败! -> Id为空";
                return;
            }
            //string Id = "100";



            // 生成红包收款码
            string PageUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + this.GetType().Name.Replace("_", "/").Replace("/aspx", ".aspx");
            string HB_QR   = PageUrl + "?" + "p=" + Id;

            // 制作红包收款码
            string picName = QrTool_HB.genHbSkPic(HB_QR, Tittle, Id, "tools\\QRTool\\QR_HB\\");

            if (!picName.Equals(""))
            {
                img_Example.Src = "~/tools/QRTool/QR_HB/" + picName;           // 显示生成的二维码
                Label_tip.Text  = "您的红包收款码已生成!";
            }
            else
            {
                Label_tip.Text = "红包收款码制作失败!";
            }

            //img_Example.Src = "~/tools/QRTool/QR/" + NAME;            // 现实二维码图像

            //Bitmap = QrTool_HB.ToQr()
            //showQR(HB_QR);

            // 制作红包收款码
            //...
            //HyperLink1.Text = "红包收款码:" + HyperLink1.NavigateUrl;
        }
コード例 #14
0
        /// <summary>
        /// 记录红包码、二维码、商家名称,返回记录id,生成新的红包收款码供商家收款
        /// </summary>
        /// <param name="e"></param>
        protected void ImageButton_Create_Click(object sender, ImageClickEventArgs e)
        {
            // 检测红包码、收款码变动
            TextBox_HB_TextChanged(null, null);
            TextBox_SK_TextChanged(null, null);

            string QrUrl  = TextBox_SK.Text.Trim();     // 收款码
            string HbUrl  = TextBox_HB.Text.Trim();     // 红包码
            string Tittle = TextBox_Tittle.Text.Trim(); // 商家名称

            if (HbUrl.Equals("") || HbUrl.Contains("红包码") || HbUrl.StartsWith("Error:") || HbUrl.Contains("undefined"))
            {
                Label_tip.Text = "请先点击,添加您的红包码!";
                return;
            }
            if (QrUrl.Equals("") || QrUrl.Contains("收款码") || QrUrl.StartsWith("Error:") || QrUrl.Contains("undefined"))
            {
                Label_tip.Text = "请先点击,添加您的收款码!";
                return;
            }
            if (Tittle.Equals("") || Tittle.Contains("第8号当铺"))
            {
                Label_tip.Text = "请添加您的商家名称!";
                return;
            }

            // 红包码,收款码 数据校验
            if (!ChekQrTrue(ref QrUrl, ref HbUrl))
            {
                //Label_tip.Text = "红包码或收款码上传错误,请重新上传!";
                return;
            }

            String ext = "";

            if (/*img_HB.Src.Contains("success_hb.png") &&*/ img_SK.Src.Contains("success_sk.png"))
            {
                ext = "mode(3)";                            // 若收款码是通过扫码方式添加的,则使用模式3
            }
            if (!QrUrl.ToLower().Trim().StartsWith("http")) // 若非以http开头,则认为是文本信息,添加showinfo前缀在网页中展示
            {
                QrUrl = "ShowInfo_" + QrUrl;
                ext   = "mode(2)";
            }

            // 记录红包码、收款码信息,返回记录id
            string commond = "TYPE=Add&QrUrl=" + QrUrl + "&HbUrl=" + HbUrl + "&Tittle=" + Tittle + "&ext=" + ext;

            string url = InfoUrl + "?" + commond;
            string Id  = ScTool.getWebData(url);

            if (Id.Equals(""))
            {
                Label_tip.Text = "红包收款码制作失败! -> Id为空";
                return;
            }
            //string Id = "100";

            // 生成红包收款码
            //string PageUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + this.GetType().Name.Replace("_", "/").Replace("/aspx", ".aspx");
            string PageUrl = "http://scimence.gitee.io/url/HB.html";

            if (Product.UseStaticIpMode)
            {
                PageUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + this.GetType().Name.Replace("_", "/").Replace("/aspx", ".aspx");
            }

            string HB_QR = PageUrl + "?" + "p=" + Id;

            // 制作红包收款码
            string picName = QrTool_HB.genHbSkPic(HB_QR, Tittle, Id, "tools\\QRTool\\QR_HB\\");

            if (!picName.Equals(""))
            {
                img_Example.Src = "~/tools/QRTool/QR_HB/" + picName;           // 显示生成的二维码
                Label_tip.Text  = "您的红包收款码已生成!";
            }
            else
            {
                Label_tip.Text = "红包收款码制作失败!";
            }

            //img_Example.Src = "~/tools/QRTool/QR/" + NAME;            // 现实二维码图像

            //Bitmap = QrTool_HB.ToQr()
            //showQR(HB_QR);

            // 制作红包收款码
            //...
            //HyperLink1.Text = "红包收款码:" + HyperLink1.NavigateUrl;
        }
コード例 #15
0
ファイル: HbPay.aspx.cs プロジェクト: scimence/QrPaySystem
        string Tittle    = "";  // 商户名称

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ScTool.RecordUserAgent(Request);                      // 记录客户端信息
            }
            //Request.Params[HTTP_HOST]:60.205.185.168:8001
            //Request.Url:http://60.205.185.168:8001/Pages/request.aspx
            //string ServerUrl = "http://" + Request.Params["HTTP_HOST"];

            QrUrl  = Request["QrUrl"];  // 当前打开
            HbUrl  = Request["HbUrl"];  // 跳转至
            Tittle = Request["Tittle"]; //

            if (QrUrl == null)
            {
                QrUrl = "";
            }
            if (HbUrl == null)
            {
                HbUrl = "https://qr.alipay.com/c1x01990gbhjvuvwaxwkqa3";                // 默认红包码
            }
            if (Tittle == null)
            {
                Tittle = "商户名称(未设置)";
            }
            if (QrUrl.StartsWith("ShowInfo_"))
            {
                QrUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/" + "PageHB/ShowInfo.aspx?p=" + QrUrl.Substring("ShowInfo_".Length);
            }


            if (QrUrl.Equals(""))
            {
                string msg = "参数QrUrl不应为空!";
                msg += "\r\n示例:" + Request.Url + "?" + "QrUrl=" + "http://www.baidu.com" + "&HbUrl=" + "" + "&Tittle=" + "第8号当铺";

                Response.Write(ScTool.Alert(msg));
                return;
            }

            LabelTittle.Text = Tittle;

            string key  = "HbPay";
            string date = DateTime.Now.ToString("yyyyMMdd");        // 每天可领取一次,首次跳转

            if (Session.Timeout != 60 * 24)
            {
                Session.Timeout = 60 * 24;                          // 设置Session有效时间为24小时
            }
            string value = "";

            if (Session[key] == null || !(Session[key] as string).StartsWith(date))  // 若key不存在,或非今天的则生成新的值
            {
                value        = date;
                Session[key] = date;
            }
            else
            {
                value = Session[key] as string;                             // 获取之前的session值
                if (!value.Contains("noFrist"))
                {
                    value = value + "noFrist";                              // 记录为非首次访问
                }
                Session[key] = value;
            }
            //Label1.Text = value;

            if (value.Contains("noFrist"))  // 非首次访问,直接跳转收款
            {
                //NewLinkDiv.InnerHtml = "<a href =\"https://qr.alipay.com/tsx031041ajtuiviwd978b6\" >支付宝收款</a>";
                Response.Redirect(QrUrl);
            }
            else
            {                               // 首次访问,跳转领取红包
                //NewLinkDiv.InnerHtml = "<a href =\"https://qr.alipay.com/c1x01990gbhjvuvwaxwkqa3\" >支付宝领红包</a>";

                //string content = "<img id=\"img1\" src=\"" + ServerUrl + "/tools/HB_pic/bg.jpg\" />";
                //content += "<a href=\"" + HbUrl + "\"><img id=\"img2\" src=\"" + ServerUrl + "/tools/HB_pic/btn.png\" alt=\"点击领取红包\" /></a>";
                //BtnDiv.InnerHtml = content;

                HbUrl            = "GetHB.aspx" + "?p=" + HbUrl; //获取红包码url
                BtnDiv.InnerHtml = "<a href=\"" + HbUrl + "\"><img src=\"../tools/HB_pic/btn.png\"></a>";

                // 红包首次访问计数
                if (Request["ID"] != null)
                {
                    string InfoUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/PageHB/HbInfo.aspx";
                    string commond = InfoUrl + "?" + "TYPE=CountAdd&ID=" + Request["ID"];
                    ScTool.getWebData(commond);
                }
            }

            //// 制作我的红包码
            //string CreateHbUrl = "http://" + Request.Params.Get("HTTP_HOST") + "/PageHB/HB.aspx";
            //LinkA.HRef = CreateHbUrl;
        }