Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Common.Cookie cookie = new Common.Cookie();
        cookie.delCookie("nick");

        Response.Redirect("default.aspx");
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string nick = utils.NewRequest("nick", utils.RequestType.QueryString);

        string sql = "SELECT * FROM TCS_ShopSession WHERE nick = '" + nick + "' AND version > 0 AND version < 4";

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

        DataTable dt = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            Rijndael_ encode = new Rijndael_("tetesoft");
            nick = encode.Encrypt(nick);

            cookie.setCookie("top_sessionblog", dt.Rows[0]["session"].ToString(), 999999);
            cookie.setCookie("nick", nick, 999999);
        }
        else
        {
            cookie.delCookie("top_sessionblog");
            cookie.delCookie("nick");
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string nick = utils.NewRequest("nick", utils.RequestType.QueryString);
        string t    = utils.NewRequest("t", utils.RequestType.QueryString);

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

        //清理之前的COOKIE
        cookie.delCookie("mircoblog");
        cookie.delCookie("act");
        cookie.delCookie("iscrm");
        cookie.delCookie("istongji");
        cookie.delCookie("istongji");

        cookie.setCookie("nick", nick, 999999);
        Rijndael_ encode     = new Rijndael_("tetesoft");
        string    taobaoNick = encode.Decrypt(nick);

        //查询是否订购了免费版
        string    sql = "SELECT * FROM TopTaobaoShop WHERE nick = '" + taobaoNick + "'";
        DataTable dt  = utils.ExecuteDataTable(sql);

        if (dt.Rows.Count != 0)
        {
            string session = dt.Rows[0]["sessionmarket"].ToString();
            cookie.setCookie("top_session", session, 999999);
            string top_appkey = "12132145";
            string app_secret = "1fdd2aadd5e2ac2909db2967cbb71e7f";

            IDictionary <string, string> param = new Dictionary <string, string>();
            param.Add("nick", taobaoNick);
            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);
            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", 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);
                    }
                }
                catch { }
            }
        }

        if (t != "")
        {
            Response.Redirect("../index.html?t=" + t);
        }
        else
        {
            Response.Redirect("../index.html");
        }
    }