Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string nick        = utils.NewRequest("nick", utils.RequestType.QueryString);
        string top_session = utils.NewRequest("session", utils.RequestType.QueryString);
        string iscrm       = utils.NewRequest("iscrm", utils.RequestType.QueryString);

        Common.Cookie cookie = new Common.Cookie();
        cookie.setCookie("top_session", top_session, 999999);
        cookie.setCookie("nick", nick, 999999);
        if (iscrm == "1")
        {
            cookie.setCookie("iscrm", "1", 999999);
        }
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(nick);

        //写入数据库
        if (iscrm == "1")
        {
            string sql   = "SELECT COUNT(*) FROM TCS_CrmConfig WHERE nick = '" + nick + "'";
            string count = utils.ExecuteString(sql);
            if (count == "0")
            {
                sql = "INSERT INTO TCS_CrmConfig (nick, session, updatedate) VALUES ('" + nick + "','" + top_session + "','" + DateTime.Now.AddMonths(-3).ToString() + "')";
                Response.Write(sql);
                utils.ExecuteNonQuery(sql);
            }
        }
    }
    /// <summary>
    /// 输出验证码
    /// </summary>
    private void OutPutVerify()
    {
        try
        {
            Train  t         = new Train();
            string cookieStr = t.GetVerifyImg();

            Common.Cookie cookie = new Common.Cookie();

            string[] ary = cookieStr.Split('|');

            cookie.setCookie("JSESSIONID", ary[0], 999999);

            if (ary.Length > 1)
            {
                cookie.setCookie("BIGipServerotsweb", ary[1], 999999);
            }
            Log(cookieStr);
            Response.End();
        }
        catch
        {
            Response.Write("err");
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        id = utils.NewRequest("id", utils.RequestType.QueryString);
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessiongroupbuy");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);


        //过期判断
        if (string.IsNullOrEmpty(taobaoNick))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=4545' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        //过期判断
        if (!IsBuy(nick))
        {
            string msg = "尊敬的" + nick + ",非常抱歉的告诉您,您尚未订购该功能,如需继续使用请购买该服务:<br><br>29元/月 【赠送短信100条】 <a href='http://fuwu.taobao.com/item/subsc.htm?items=service-0-22904-11:1;' target='_blank'>立即购买</a><br><br>78元/季 【赠送短信300条】 <a href='http://fuwu.taobao.com/item/subsc.htm?items=service-0-22904-11:3;' target='_blank'>立即购买</a><br><br>148元/半年 【赠送短信600条】<a href='http://fuwu.taobao.com/item/subsc.htm?items=service-0-22904-11:6;' target='_blank'>立即购买</a><br><br>288元/年 【赠送短信1200条】<a href='http://fuwu.taobao.com/item/subsc.htm?items=service-0-22904-11:12;' target='_blank'>立即购买</a><br>";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        BindData();
    }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessiongroupbuy");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        //判断VIP版本,只有VIP才能使用此功能
        string    sql = "SELECT * FROM TopTaobaoShop WHERE nick = '" + nick + "'";
        DataTable dt  = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            string flag = dt.Rows[0]["versionNoBlog"].ToString();
            if (flag == "0")
            {
                Response.Redirect("xufei.aspx");
                Response.End();
                return;
            }
        }

        BindData();
    }
Exemple #5
0
    private void BindData()
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");
        string        session    = cookie.getCookie("top_sessionblog");

        //COOKIE过期判断
        if (taobaoNick == "")
        {
            //SESSION超期 跳转到登录页
            Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12159997'</script>");
            Response.End();
        }

        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick = encode.Decrypt(taobaoNick);

        //获取用户店铺商品列表
        TopXmlRestClient      client  = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", "12159997", "614e40bfdb96e9063031d1a9e56fbed5");
        ItemsOnsaleGetRequest request = new ItemsOnsaleGetRequest();

        request.Fields   = "num_iid,title,price,pic_url";
        request.Q        = tbKey.Text;
        request.PageSize = 5;
        request.OrderBy  = "volume:desc";

        PageList <Item> product = new PageList <Item>();

        try
        {
            product = client.ItemsOnsaleGet(request, session);
        }
        catch (Exception e)
        {
            if (e.Message == "27:Invalid session:Session not exist")
            {
                //SESSION超期 跳转到登录页
                Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12159997'</script>");
                Response.End();
            }
            return;
        }
        rptProduct.DataSource = product.Content;
        rptProduct.DataBind();

        //数据绑定
        string    sqlNew = "SELECT TOP 10 * FROM TopIdea WHERE nick = '" + taobaoNick + "' ORDER BY id DESC";
        DataTable dtNew  = utils.ExecuteDataTable(sqlNew);

        rptAds.DataSource = dtNew;
        rptAds.DataBind();

        //数据绑定
        sqlNew = "SELECT * FROM TopBlogLink WHERE nick = '" + taobaoNick + "' ORDER BY id DESC";
        dtNew  = utils.ExecuteDataTable(sqlNew);

        rptLink.DataSource = dtNew;
        rptLink.DataBind();
    }
Exemple #6
0
    /// <summary>
    /// 图片上传
    /// </summary>
    /// <param name="picurl"></param>
    /// <param name="picname"></param>
    /// <param name="CategoryId"></param>
    /// <returns></returns>
    public string TaobaoUpload(string picurl, string picname, long CategoryId)
    {
        Common.Cookie        cookie   = new Common.Cookie();
        string               session  = cookie.getCookie("top_sessiongroupbuy");
        TopXmlRestClient     clientaa = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", appkey, secret);
        PictureUploadRequest request  = new PictureUploadRequest();

        string filepath = Server.MapPath("images/" + picurl);

        request.Img               = new FileItem(filepath, File.ReadAllBytes(filepath));
        request.ImageInputTitle   = picurl;
        request.PictureCategoryId = CategoryId;
        request.Title             = picname;

        try
        {
            clientaa.PictureUpload(request, session);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
            Response.End();
        }

        PictureGetRequest request1 = new PictureGetRequest();

        request1.Title = picname;
        string path = string.Empty;

        path = clientaa.PictureGet(request1, session).Content[0].PicturePath;

        return(path);
    }
Exemple #7
0
    /// <summary>
    /// 删除优惠券信息
    /// </summary>
    private void DeleteGroup()
    {
        //判断如果活动未开始或进行中则可以关闭活动
        string id = utils.NewRequest("id", utils.RequestType.QueryString);
        //if (!utils.IsInt32(id))
        //{
        //    return;
        //}

        //删除活动
        string appkey = "12159997";
        string secret = "614e40bfdb96e9063031d1a9e56fbed5";
        IDictionary <string, string> param = new Dictionary <string, string>();

        Common.Cookie cookie  = new Common.Cookie();
        string        session = cookie.getCookie("top_sessiongroupbuy");

        string sql      = "SELECT couponid FROM TCS_ShopConfig WHERE nick = '" + nick + "'";
        string couponid = utils.ExecuteString(sql);

        if (couponid == id)
        {
            Response.Write("<script>alert('默认赠送的优惠券无法删除,请您到“基本设置”里面更改默认优惠券后再删除!');history.go(-1);</script>");
            return;
        }

        //通过数据库查询获取活动ID
        sql = "UPDATE TCS_Coupon SET isdel = 1 WHERE guid = '" + id + "'";
        utils.ExecuteNonQuery(sql);

        Response.Write("<script>alert('取消成功!');window.location.href='couponlist.aspx';</script>");
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        //过期判断
        if (string.IsNullOrEmpty(taobaoNick))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=11807' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        id  = utils.NewRequest("id", Common.utils.RequestType.QueryString);
        url = "addtotaobaoactivity-2.aspx";

        style = utils.NewRequest("style", Common.utils.RequestType.Form);
        size  = utils.NewRequest("size", Common.utils.RequestType.Form);
        name  = utils.NewRequest("ideaName", Common.utils.RequestType.Form);

        //判断是否为编辑状态
        id = utils.NewRequest("id", Common.utils.RequestType.QueryString);

        if (id != "" && !utils.IsInt32(id))
        {
            Response.Write("非法参数1");
            Response.End();
            return;
        }

        BindData();
    }
    /// <summary>
    /// 删除优惠券信息
    /// </summary>
    private void DeleteGroup()
    {
        //判断如果活动未开始或进行中则可以关闭活动
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        if (!utils.IsInt32(id))
        {
            return;
        }

        //删除活动
        string appkey = "12159997";
        string secret = "614e40bfdb96e9063031d1a9e56fbed5";
        IDictionary <string, string> param = new Dictionary <string, string>();

        Common.Cookie cookie  = new Common.Cookie();
        string        session = cookie.getCookie("top_sessiongroupbuy");

        //通过数据库查询获取活动ID
        string sql = "UPDATE TopCoupon SET isdel = 1 WHERE id = " + id;

        utils.ExecuteNonQuery(sql);

        Response.Write("<script>alert('取消成功!');window.location.href='couponlist.aspx';</script>");
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        //过期判断
        if (string.IsNullOrEmpty(taobaoNick))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=11807' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        string act = utils.NewRequest("act", utils.RequestType.QueryString);

        if (act == "del")
        {
            Delete();
            return;
        }

        //获取买家的团购信息清单
        BindData();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessionsale");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        string act = utils.NewRequest("act", utils.RequestType.QueryString);
        string t   = utils.NewRequest("t", utils.RequestType.Form);
        string ids = utils.NewRequest("id", utils.RequestType.Form);

        if (act == "send")
        {
            Delete();
            return;
        }

        //批量操作评论
        if (t != "")
        {
            MultiConfirm(t, ids);
        }

        if (!IsPostBack)
        {
            BindData();
        }
    }
Exemple #12
0
    /// <summary>
    /// 清除宝贝描述
    /// </summary>
    /// <param name="id">模板ID</param>
    /// <param name="aid">活动ID</param>
    public void ClearitemsDesc(string id, string aid)
    {
        if (id != "" && !utils.IsInt32(id))
        {
            Response.Write("非法参数1");
            Response.End();
            return;
        }

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");
        string        session    = cookie.getCookie("top_sessiongroupbuy");

        //COOKIE过期判断
        if (taobaoNick == "")
        {
            //SESSION超期 跳转到登录页
            Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12287381'</script>");
            Response.End();
        }

        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick = encode.Decrypt(taobaoNick);

        string sql   = "SELECT COUNT(*) FROM Tete_ActivityMission WHERE shoptempletID = " + id + " AND typ='delete' AND isok = 0 AND nick<>''";
        string count = utils.ExecuteString(sql);

        if (count != "0")
        {
            Response.Write("<script>alert('创建任务失败,有同类型的任务正在执行中,请等待其完成后再创建新的任务!');window.location.href='activitymissionlist.aspx';</script>");
            Response.End();
            return;
        }


        if (taobaoNick.Trim() == "")
        {
            //SESSION超期 跳转到登录页
            Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12287381'</script>");
            Response.End();
        }
        sql = "INSERT INTO Tete_ActivityMission (typ, nick, ActivityID,IsOK,shoptempletID,Success,Fail,Startdate) VALUES ('delete','" + taobaoNick + "','" + aid + "',0,'" + id + "',0,0,'" + DateTime.Now.ToString() + "')";
        utils.ExecuteNonQuery(sql);


        sql = "SELECT TOP 1 ID FROM Tete_ActivityMission ORDER BY ID DESC";
        string missionid = utils.ExecuteString(sql);



        //更新任务总数
        sql   = "SELECT COUNT(*) FROM Tete_ActivityWriteContent WHERE shoptempletID = '" + id + "' and ActivityID=" + aid + " AND isok = 1";
        count = utils.ExecuteString(sql);
        sql   = "UPDATE tete_ActivityMission SET total = '" + count + "' WHERE id = " + missionid;
        utils.ExecuteNonQuery(sql);
        // 清除宝贝描述
        DeleteTaobaoitmes(taobaoNick);
        Response.Redirect("activitymissionlist.aspx");
    }
Exemple #13
0
    /// <summary>
    /// 替换关键字
    /// </summary>
    /// <param name="content"></param>
    /// <returns></returns>
    private string changeKey(string content)
    {
        Common.Cookie cookie1     = new Common.Cookie();
        string        taobaoNick1 = cookie1.getCookie("nick");
        string        nickid      = string.Empty;

        //COOKIE过期判断
        if (taobaoNick1 == "")
        {
            //SESSION超期 跳转到登录页
            Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12159997'</script>");
            Response.End();
        }
        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick1 = encode.Decrypt(taobaoNick1);


        //替换掉博客文章里面的关键字
        string    sql = "SELECT * FROM TopBlogLink WHERE nick = '" + taobaoNick1 + "'";
        DataTable dt  = utils.ExecuteDataTable(sql);

        if (dt != null && dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                content = content.Replace(dt.Rows[i]["keyword"].ToString(), "<a href='" + dt.Rows[i]["link"].ToString() + "' target='_blank'>" + dt.Rows[i]["keyword"].ToString() + "</a>");
            }
        }


        return(content);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessiongroupbuy");
        string    iscrm  = cookie.getCookie("iscrm");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        //过期判断
        if (string.IsNullOrEmpty(taobaoNick))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=4545' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        //过期判断
        if (!IsBuy(nick))
        {
            string msg = "尊敬的" + nick + ",非常抱歉的告诉您,只有VIP版本才能使用【客户关系营销】功能,如需继续使用请<a href='http://fuwu.taobao.com/ser/detail.htm?service_code=service-0-22904&frm=haoping' target='_blank'>购买高级会员服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }
    }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie1    = new Common.Cookie();
        string        taobaoNick = cookie1.getCookie("nick");
        string        session    = cookie1.getCookie("top_session");
        string        isAct      = cookie1.getCookie("act");
        Rijndael_     encode     = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        //过期判断
        if (string.IsNullOrEmpty(session))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=764' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        //过期判断
        if (isAct != "1")
        {
            string msg = "尊敬的" + nick + ",非常抱歉的告诉您,您尚未订购该功能,如需继续使用请<a href='http://fuwu.taobao.com/item/subsc.htm?items=service-0-22762-10:1;' target='_blank'>购买该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        FormatData();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick = encode.Decrypt(taobaoNick);

        string act = utils.NewRequest("act", utils.RequestType.QueryString);
        string id  = utils.NewRequest("id", utils.RequestType.QueryString);

        if (id != "" && !utils.IsInt32(id))
        {
            Response.Write("非法参数1");
            Response.End();
            return;
        }

        if (act == "del")
        {
            string sqlnew = "DELETE FROM TopBlogSearchKey WHERE nick = '" + taobaoNick + "' AND id = " + id;
            utils.ExecuteNonQuery(sqlnew);

            Response.Redirect("linklistnew.aspx");
            return;
        }

        string    sqlNew = "SELECT * FROM TopBlogSearchKey WHERE nick = '" + taobaoNick + "' ORDER BY id DESC";
        DataTable dtNew  = utils.ExecuteDataTable(sqlNew);

        rptArticle.DataSource = dtNew;
        rptArticle.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Common.Cookie cookie     = new Common.Cookie();
            string        taobaoNick = cookie.getCookie("nick");
            string        nickid     = string.Empty;

            //过期判断
            if (string.IsNullOrEmpty(taobaoNick))
            {
                Response.Write("<script>window.location.href='http://container.open.taobao.com/container?appkey=12159997'</script>");
                Response.End();
                return;
            }

            Rijndael_ encode = new Rijndael_("tetesoft");
            taobaoNick = encode.Decrypt(taobaoNick);

            string    sqlNew = "SELECT sid FROM TopTaobaoShop WHERE nick = '" + taobaoNick + "'";
            DataTable dtNew  = utils.ExecuteDataTable(sqlNew);
            if (dtNew.Rows.Count != 0)
            {
                nickid = "http://shop" + dtNew.Rows[0]["sid"].ToString() + ".taobao.com/";
            }
            else
            {
                nickid = "http://www.taobao.com/";
            }

            this.TextBox2.Text = nickid;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_session");
        st      = cookie.getCookie("short");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        string sql = "SELECT * FROM TeteShopCategory WHERE nick = '" + st + "' AND parentid=0 ORDER BY orderid";

        if (!IsPostBack)
        {
            DataTable dt = utils.ExecuteDataTable(sql);
            ddl1.DataSource     = dt;
            ddl1.DataTextField  = "catename";
            ddl1.DataValueField = "cateid";
            ddl1.DataBind();


            sql = "SELECT * FROM TeteShopItem WHERE nick = '" + st + "' AND isnew = 1 ORDER BY orderid";

            dt = utils.ExecuteDataTable(sql);
            rpt1.DataSource = dt;
            rpt1.DataBind();
        }
    }
    private void Delete()
    {
        //判断如果活动未开始或进行中则可以关闭活动
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        if (!utils.IsInt32(id))
        {
            return;
        }

        //删除活动
        string appkey = "12132145";
        string secret = "1fdd2aadd5e2ac2909db2967cbb71e7f";
        IDictionary <string, string> param = new Dictionary <string, string>();

        Common.Cookie cookie  = new Common.Cookie();
        string        session = cookie.getCookie("top_session");

        //通过数据库查询获取活动ID
        string sql          = "SELECT promotionid FROM TopGroupBuy WHERE id = " + id;
        string promotion_id = utils.ExecuteString(sql);

        //创建活动
        param = new Dictionary <string, string>();
        param.Add("promotion_id", promotion_id);
        string result = Post("http://gw.api.taobao.com/router/rest", appkey, secret, "taobao.marketing.promotion.delete", session, param);

        //更新数据库
        sql = "UPDATE TopGroupBuy SET isdelete = 1 WHERE id = " + id;
        utils.ExecuteNonQuery(sql);

        Response.Redirect("deletegrouplist.aspx");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie = new Common.Cookie();
        cookie.delCookie("nick");

        Response.Redirect("default.aspx");
    }
Exemple #21
0
    private void BindData()
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick = encode.Decrypt(taobaoNick);


        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        string    sql   = "SELECT * FROM TopGroupBuyDetail WHERE groupbuyid =" + id;
        DataTable dtNew = utils.ExecuteDataTable(sql);

        dtNew = ConvertTable(dtNew);

        rptArticle.DataSource = dtNew;
        rptArticle.DataBind();


        sql   = "SELECT * FROM TopGroupBuy WHERE nick = '" + taobaoNick + "' AND id = " + id;
        dtNew = utils.ExecuteDataTable(sql);
        Repeater1.DataSource = dtNew;
        Repeater1.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessionsale");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        if (!IsPostBack)
        {
            string    sql = "SELECT * FROM TCS_ShopConfig WHERE nick = '" + nick + "'";
            DataTable dt  = utils.ExecuteDataTable(sql);
            if (dt.Rows.Count != 0)
            {
                wordcount = dt.Rows[0]["wordcount"].ToString();
                keyword   = dt.Rows[0]["keyword"].ToString().Replace("|", "\r\n");
            }
            else
            {
                Response.Write("请先到基本设置里面进行信息设置,<a href='setting.aspx'>点此进入</a>");
                Response.End();
            }
        }
    }
    /// <summary>
    /// 删除团购
    /// </summary>
    /// <param name="gid">团购ID</param>
    private void DeleteTaobao(string gid)
    {
        //获取正在进行中的宝贝同步任务
        string           appkey    = "12287381";
        string           secret    = "d3486dac8198ef01000e7bd4504601a4";
        string           session   = string.Empty;
        string           id        = string.Empty;
        string           missionid = string.Empty;
        string           html      = string.Empty;
        TopXmlRestClient client    = new TopXmlRestClient("http://gw.api.taobao.com/router/rest", appkey, secret);

        string sql = "SELECT t.*, s.sessiongroupbuy FROM TopMission t INNER JOIN TopTaobaoShop s ON s.nick = t.nick WHERE groupbuyid=" + gid;

        DataTable dt = utils.ExecuteDataTable(sql);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            id = dt.Rows[i]["groupbuyid"].ToString();
            clearGroupbuy(id);
            session   = dt.Rows[i]["sessiongroupbuy"].ToString();
            missionid = dt.Rows[i]["id"].ToString();
            html      = "";

            sql = "delete from TopWriteContent where groupbuyid =  '" + dt.Rows[i]["groupbuyid"].ToString() + "'";
            utils.ExecuteNonQuery(sql);
            if (dt.Rows[i]["itemid"] != null && dt.Rows[i]["itemid"].ToString() != "" && dt.Rows[i]["itemid"].ToString() != "NULL")
            {
                RecordMissionDetail(id, missionid, dt.Rows[i]["itemid"].ToString(), "");
            }
            for (int j = 1; j <= 500; j++)
            {
                ItemsOnsaleGetRequest request = new ItemsOnsaleGetRequest();
                request.Fields   = "num_iid,title,price,pic_url";
                request.PageSize = 200;
                request.PageNo   = j;

                Common.Cookie cookie     = new Common.Cookie();
                string        taobaoNick = dt.Rows[i]["nick"].ToString();
                try
                {
                    PageList <Item> product = client.ItemsOnsaleGet(request, session);
                    for (int num = 0; num < product.Content.Count; num++)
                    {
                        RecordMissionDetail(id, missionid, product.Content[num].NumIid.ToString(), html);
                    }
                    if (product.Content.Count < 200)
                    {
                        break;
                    }
                }
                catch (Exception e)
                {
                    sql = "UPDATE TopMission SET fail = fail + 1,isok = -1 WHERE id = " + dt.Rows[i]["id"].ToString();
                    utils.ExecuteNonQuery(sql);
                    break;
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string q       = utils.NewRequest("q", utils.RequestType.QueryString);
        string url     = "http://captcha.qq.com/getimage?aid=46000101&r=0.03370694697363402&vc_type=5dedbca8871cd5308d6ad6d641e3539c386932b3dfc8c5a1&uin=" + q;
        string strHtml = string.Empty;

        StreamReader  sr       = null;                          //用来读取流
        StreamWriter  sw       = null;                          //用来写文件
        Encoding      code     = Encoding.GetEncoding("utf-8"); //定义编码
        ASCIIEncoding encoding = new ASCIIEncoding();
        //构造web请求,发送请求,获取响应
        WebRequest HttpWebRequest = null;

        HttpWebRequest = WebRequest.Create(url);

        WebResponse HttpWebResponse = null;

        HttpWebResponse = HttpWebRequest.GetResponse();
        //获得流
        //sr = new StreamReader(HttpWebResponse.GetResponseStream(), code);
        //strHtml = sr.ReadToEnd();
        byte[] arrayByte;

        Stream stream = HttpWebResponse.GetResponseStream();

        //获取服务器设置的COOKIE
        if (HttpWebResponse.Headers.ToString().IndexOf("Set-Cookie") != -1)
        {
            string cookiestr = HttpWebResponse.Headers.Get("Set-Cookie").ToString();
            Regex  reg       = new Regex(@"verifysession\=([^;]*)\;");
            string verify    = string.Empty;
            if (reg.IsMatch(cookiestr))
            {
                Match match = reg.Match(cookiestr);
                verify = match.Groups[1].ToString();
                //保存进COOKIE
                Common.Cookie cookie = new Common.Cookie();
                cookie.setCookie("qqverify", verify, 999999);
            }
        }

        //保存图片
        int imgLong = (int)HttpWebResponse.ContentLength;

        arrayByte = new byte[imgLong];
        int l = 0;

        while (l < imgLong)
        {
            int i = stream.Read(arrayByte, 0, imgLong);
            l += i;
        }
        stream.Close();
        HttpWebResponse.Close();

        Response.ClearContent();
        Response.ContentType = "image/gif";
        Response.BinaryWrite(arrayByte);
    }
Exemple #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id  = utils.NewRequest("id", utils.RequestType.QueryString);
        string act = utils.NewRequest("act", utils.RequestType.QueryString);

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessiongroupbuy");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        //过期判断
        if (string.IsNullOrEmpty(taobaoNick))
        {
            string msg = "尊敬的淘宝卖家,非常抱歉的告诉您,您还没有购买此服务或者登录信息已失效,如需继续使用请<a href='http://fuwu.taobao.com/serv/detail.htm?service_id=4545' target='_blank'>进入该服务</a>,谢谢!";
            Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
            Response.End();
            return;
        }

        //判断VIP版本,只有VIP才能使用此功能
        string    sql = "SELECT * FROM TCS_ShopSession WHERE nick = '" + nick + "'";
        DataTable dt  = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            string flag = dt.Rows[0]["version"].ToString();
            if (flag == "0")
            {
                Response.Redirect("xufei.aspx");
                Response.End();
                return;
            }
        }

        string action = utils.NewRequest("action", utils.RequestType.Form);

        if (action == "save")
        {
            SaveIndexInfo();
            return;
        }

        if (act == "add")
        {
            InitTradeRateData(id);
            return;
        }

        if (act == "del")
        {
            DelTradeRateData(id);
            return;
        }

        BindData();
    }
    /// <summary>
    /// 创建删除活动关联的宝贝描述
    /// </summary>
    private void Delete()
    {
        Common.Cookie cookie = new Common.Cookie();
        //判断如果活动未开始或进行中则可以关闭活动
        string taobaoNick = cookie.getCookie("nick");
        string session    = cookie.getCookie("top_sessiongroupbuy");

        //COOKIE过期判断
        if (taobaoNick == "")
        {
            return;
        }

        string    id     = utils.NewRequest("id", utils.RequestType.QueryString);
        Rijndael_ encode = new Rijndael_("tetesoft");

        taobaoNick = encode.Decrypt(taobaoNick);

        string sql   = "SELECT COUNT(*) FROM TopMission WHERE groupbuyid = " + id + " AND typ='delete' AND isok = 0 AND nick<>''";
        string count = utils.ExecuteString(sql);

        if (count != "0")
        {
            return;
        }

        if (taobaoNick.Trim() == "")
        {
            //SESSION超期 跳转到登录页
            Response.Write("<script>parent.location.href='http://container.open.taobao.com/container?appkey=12287381'</script>");
            Response.End();
        }
        sql = "INSERT INTO TopMission (typ, nick, groupbuyid) VALUES ('delete', '" + taobaoNick + "', '" + id + "')";
        utils.ExecuteNonQuery(sql);


        sql = "SELECT TOP 1 ID FROM TopMission ORDER BY ID DESC";
        string missionid = utils.ExecuteString(sql);

        //获取团购信息并更新
        sql = "SELECT name,productimg,productid FROM TopGroupBuy WHERE id = '" + id + "'";
        DataTable dt = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            sql = "UPDATE TopMission SET groupbuyname = '" + dt.Rows[0]["name"].ToString() + "',groupbuypic = '" + dt.Rows[0]["productimg"].ToString() + "',itemid = '" + dt.Rows[0]["productid"].ToString() + "' WHERE id = " + missionid;
            utils.ExecuteNonQuery(sql);
        }

        //更新任务总数
        sql   = "SELECT COUNT(*) FROM TopWriteContent WHERE groupbuyid = '" + id + "' AND isok = 1";
        count = utils.ExecuteString(sql);
        sql   = "UPDATE TopMission SET total = '" + count + "' WHERE id = " + missionid;
        utils.ExecuteNonQuery(sql);
        //清除宝贝描述
        DeleteTaobao(taobaoNick);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = utils.NewRequest("id", utils.RequestType.QueryString);

        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessiongroupbuy");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);

        //判断VIP版本,只有VIP才能使用此功能
        string    sql = "SELECT * FROM TopTaobaoShop WITH (NOLOCK) WHERE nick = '" + nick + "'";
        DataTable dt  = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            string flag = dt.Rows[0]["versionNoBlog"].ToString();

            if (flag == "0")
            {
                Response.Redirect("xufei.aspx");
                Response.End();
                return;
            }

            if (flag != "3")
            {
                string msg = "尊敬的" + nick + ",非常抱歉的告诉您,只有VIP版本才能使用【评价手动审核】功能,如需继续使用请<a href='http://fuwu.taobao.com/ser/detail.htm?service_code=service-0-22904&frm=haoping' target='_blank'>购买高级会员服务</a>,谢谢!";
                Response.Redirect("buy.aspx?msg=" + HttpUtility.UrlEncode(msg));
                Response.End();
                return;
            }
        }

        string act = utils.NewRequest("act", utils.RequestType.QueryString);
        string t   = utils.NewRequest("t", utils.RequestType.Form);
        string ids = utils.NewRequest("id", utils.RequestType.Form);

        if (act == "send")
        {
            Delete();
            return;
        }

        //批量操作评论
        if (t != "")
        {
            MultiConfirm(t, ids);
        }

        if (!IsPostBack)
        {
            BindData();
        }
    }
Exemple #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql = string.Empty;

        appKey    = "d3225497956249cbb13a7cb7375d62bd";
        appSecret = "6cf7a3274cb676328e77dff3e203061d";

        Common.Cookie cookie = new Common.Cookie();
        tokenKey    = cookie.getCookie("tokenKey");
        tokenSecret = cookie.getCookie("tokenSecret");
        uid         = cookie.getCookie("uid");

        string act      = utils.NewRequest("act", utils.RequestType.QueryString);
        string listento = utils.NewRequest("listento", utils.RequestType.QueryString);

        if (act == "listen")
        {
            //每小时最多一键收听一次
            sql = "SELECT COUNT(*) FROM TopMicroBlogNumLog WHERE typ = 'add' AND uid = '" + uid + "' AND  DATEDIFF(s, adddate, GETDATE() ) < 3600";
            string count = utils.ExecuteString(sql);
            if (int.Parse(count) < 10)
            {
                listen(listento);

                //记录操作日志
                sql = "INSERT INTO TopMicroBlogNumLog (uid, typ, num, bak) VALUES ('" + uid + "', 'add', 1, '" + listento + "')";
                utils.ExecuteNonQuery(sql);

                //减少积分
                sql = "UPDATE TopMicroBlogAccount SET score = score + 1 WHERE uid = '" + uid + "'";
                utils.ExecuteNonQuery(sql);

                //如果这个人积分为0则给他发送私信提醒他回来赚积分
                sql = "SELECT score FROM TopMicroBlogAccount WHERE uid = '" + uid + "'";

                Response.Redirect("hand.aspx");
                return;
            }
            else
            {
                Response.Write("<script>alert('每小时最多收听10个别人的微博,请您过一会再来:)');history.go(-1);</script>");
                Response.End();
                return;
            }
        }

        //每小时最多一键收听一次
        sql = "SELECT TOP 16 uid FROM TopMicroBlogAccount WHERE typ = 'qq' AND score > 0 AND uid <> '' AND uid NOT IN (SELECT listen FROM TopMicroBlogListen WHERE uid = '" + uid + "') ORDER BY NEWID()";

        DataTable dt = utils.ExecuteDataTable(sql);

        rptArticle.DataSource = dt;
        rptArticle.DataBind();


        lbPage.Text = InitPageStr(200, "hand.aspx");
    }
    /// <summary>
    /// ////////////////////////////////////////////
    /// </summary>
    /// <param name="t"></param>
    /// <param name="u"></param>



    private void CheckUser(string t, string u)
    {
        string top_appkey = "12132145";
        string app_secret = "1fdd2aadd5e2ac2909db2967cbb71e7f";
        string sql        = string.Empty;

        IDictionary <string, string> param = new Dictionary <string, string>();

        param.Add("nick", u);
        param.Add("article_code", "service-0-22762");
        string resultnew = Post("http://gw.api.taobao.com/router/rest", top_appkey, app_secret, "taobao.vas.subscribe.get", "", param);

        Regex reg = new Regex(@"<article_user_subscribe><item_code>([^<]*)</item_code><deadline>([^<]*)</deadline></article_user_subscribe>", RegexOptions.IgnoreCase);
        //更新日期
        MatchCollection match = reg.Matches(resultnew);

        Common.Cookie cookie = new Common.Cookie();
        for (int i = 0; i < match.Count; i++)
        {
            try
            {
                //腾讯微博自动推广
                if (match[i].Groups[1].ToString() == "service-0-22762-9")
                {
                    param = new Dictionary <string, string>();
                    string result = Post("http://gw.api.taobao.com/router/rest", top_appkey, app_secret, "taobao.increment.customer.permit", top_session, param);

                    cookie.setCookie("mircoblog", "1", 999999);
                }

                //腾讯微博自动fensi
                if (match[i].Groups[1].ToString() == "service-0-22762-10")
                {
                    cookie.setCookie("act", "1", 999999);
                }

                //CRM客户端收费
                if (match[i].Groups[1].ToString() == "service-0-22762-4")
                {
                    cookie.setCookie("iscrm", "1", 999999);
                }

                //特特统计收费
                if (match[i].Groups[1].ToString() == "service-0-22762-8")
                {
                    cookie.setCookie("istongji", "1", 999999);
                }
                //手机客户端
                if (match[i].Groups[1].ToString() == "service-0-22762-6")
                {
                    cookie.setCookie("mobile", "1", 999999);
                }
            }
            catch { }
        }
    }
Exemple #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie     = new Common.Cookie();
        string        taobaoNick = cookie.getCookie("nick");

        session = cookie.getCookie("top_sessionsale");
        Rijndael_ encode = new Rijndael_("tetesoft");

        nick = encode.Decrypt(taobaoNick);
    }