Ejemplo n.º 1
0
        public static bool check_coupon_status(string activity_id, string num_iid)
        {
            string    str2    = "https://uland.taobao.com/cp/coupon?ctoken=&activityId={activity_id}&pid=mm_116920901_19972504_72134191&itemId={num_iid}&src=haopintui&dx=1";
            string    address = str2.Replace("{activity_id}", activity_id).Replace("{num_iid}", num_iid);
            WebClient client  = new WebClient();

            client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
            client.Headers.Add("X-Requested-With", "XMLHttpRequest");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            client.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
            client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
            client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
            //client.Headers.Add("Cookie", cookie);
            string body = "";

            byte[] buffer = client.DownloadData(address);
            string str5   = client.ResponseHeaders["Content-Encoding"];

            if ("gzip".Equals(str5))
            {
                body = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
            }
            else
            {
                body = Encoding.UTF8.GetString(buffer);
            }
            if (
                //body.Contains("\"retStatus\":1") ||
                body.Contains("\"retStatus\":2"))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
    public static BrandItem smethod_3(string string_1, string string_2)
    {
        BrandItem class2  = new BrandItem();
        string    address = "http://item.taobao.com/item.htm?spm=0.0.0.0.7NgNnN&id=" + string_1;
        WebClient client  = new WebClient();

        client.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
        client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
        client.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.5o4qvy");
        client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
        client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
        client.Headers.Add("Cookie", string_2);
        string str2  = GzipUtil.zip_to_string(client.DownloadData(address), Encoding.GetEncoding("GB2312"));
        int    index = str2.IndexOf("<ul id=\"J_AttrUL\">");

        if (index != -1)
        {
            int startIndex = str2.IndexOf("品牌:", index);
            if (startIndex != -1)
            {
                startIndex += 3;
                int num4 = str2.IndexOf("<", startIndex) - startIndex;
                if (num4 > 0)
                {
                    string str3 = smethod_4(GzipUtil.smethod_4(str2.Substring(startIndex, num4)));
                    class2.string_0 = str3;
                }
            }
            int num5 = str2.IndexOf("型号:", index);
            if (num5 != -1)
            {
                num5 += 3;
                int num6 = str2.IndexOf("<", num5) - num5;
                if (num6 > 0)
                {
                    string str4 = smethod_4(GzipUtil.smethod_4(str2.Substring(num5, num6)));
                    class2.string_1 = str4;
                }
            }
            int num7 = str2.IndexOf("货号:", index);
            if (num7 != -1)
            {
                num7 += 3;
                int num8 = str2.IndexOf("<", num7) - num7;
                if (num8 > 0)
                {
                    string str5 = smethod_4(GzipUtil.smethod_4(str2.Substring(num7, num8)));
                    class2.string_2 = str5;
                }
            }
            int length = str2.IndexOf("</ul>", index) - index;
            if (length > 0)
            {
                string str6 = smethod_4(GzipUtil.smethod_4(str2.Substring(index, length)));
                str6            = str6.Substring(0, str6.LastIndexOf("</li>") + 5) + "</ul>";
                class2.string_3 = str6;
            }
        }
        return(class2);
    }
Ejemplo n.º 3
0
    public static AlimamaQueryBean get_img_url(CmsForm cmsForm, string url, string cookie, out string sessionid)
    {
        sessionid = "";
        AlimamaQueryBean alimamaQueryBean = null;

        try
        {
            WebClient client = new WebClient();
            client.Headers.Clear();
            client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
            client.Headers.Add("X-Requested-With", "XMLHttpRequest");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            client.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm");
            client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
            client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
            client.Headers.Add("Cookie", cookie);
            string str4   = "";
            byte[] buffer = client.DownloadData(url);
            string str5   = client.ResponseHeaders["Content-Encoding"];
            if ("gzip".Equals(str5))
            {
                str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
            }
            else
            {
                str4 = Encoding.UTF8.GetString(buffer);
            }

            if (str4.Contains("sessionid: '"))
            {
                alimamaQueryBean = new AlimamaQueryBean();
                sessionid        = StringUtil.subString(str4, 0, "sessionid: '", "'");
                if (!string.IsNullOrEmpty(sessionid))
                {
                    alimamaQueryBean.sessionid = sessionid;
                    alimamaQueryBean.img_url   = "http://pin.aliyun.com/get_img?identity=sm-union-pub&sessionid=" + sessionid + "&type=number&t=1497692646342";
                    alimamaQueryBean.action    = StringUtil.subString(str4, 0, "action: '", "'");
                    alimamaQueryBean.event_submit_do_unique = StringUtil.subString(str4, 0, "event_submit_do_unique: '", "'");
                    alimamaQueryBean.smPolicy  = StringUtil.subString(str4, 0, "smPolicy: '", "'");
                    alimamaQueryBean.smApp     = StringUtil.subString(str4, 0, "smApp: '", "'");
                    alimamaQueryBean.smReturn  = StringUtil.subString(str4, 0, "smReturn: '", "'");
                    alimamaQueryBean.smCharset = StringUtil.subString(str4, 0, "smCharset: '", "'");
                    alimamaQueryBean.smTag     = StringUtil.subString(str4, 0, "smTag: '", "'");
                    alimamaQueryBean.captcha   = StringUtil.subString(str4, 0, "captcha: '", "'");
                    alimamaQueryBean.smSign    = StringUtil.subString(str4, 0, "smSign: '", "'");

                    alimamaQueryBean.identity = StringUtil.subString(str4, 0, "identity: '", "'");

                    return(alimamaQueryBean);
                }
            }
            return(null);
        }
        catch (Exception exception)
        {
            return(null);
        }
    }
Ejemplo n.º 4
0
    public static ArrayList smethod_8(string string_1, string string_2, int int_2, out string string_3)
    {
        string str = "";

        try
        {
            string address = "https://s.taobao.com/search?q={schkey}&js=1&ie=utf8&sort=sale-desc";
            if (int_2 > 1)
            {
                address = "https://s.taobao.com/search?q={schkey}&js=1&ie=utf8&sort=sale-desc&bcoffset=0&p4ppushleft=%2C44&s={pageno}";
                address = address.Replace("{pageno}", ((int_2 - 1) * 0x2c) + "");
            }
            address = address.Replace("{schkey}", HttpUtility.UrlEncode(string_1));
            WebClient client = new WebClient();
            client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36");
            client.Headers.Add("Upgrade-Insecure-Requests", "1");
            client.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
            client.Headers.Add("Accept-Encoding", "gzip, deflate, sdch");
            client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
            client.Headers.Add("Cookie", string_2);
            byte[] buffer = client.DownloadData(address);
            string str3   = client.ResponseHeaders["Content-Encoding"];
            if ("gzip".Equals(str3))
            {
                str = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
            }
            else
            {
                str = Encoding.UTF8.GetString(buffer);
            }
            ArrayList list = new ArrayList();
            string    str4 = StringUtil.subString(str, 0, "\"auctions\":[{\"", "\"");
            str4 = "\"" + str4 + "\":";
            for (int i = 0; (i = str.IndexOf(str4, i)) != -1; i++)
            {
                GoodsItem class2 = new GoodsItem();
                class2.num_iid = StringUtil.subString(str, i, "\"nid\":\"", "\"");
                class2.title   = StringUtil.subString(str, i, "\"raw_title\":\"", "\",").Replace("'", "");
                list.Add(class2);
            }
            string_3 = "";
            return(list);
        }
        catch (Exception exception)
        {
            string_3 = "【" + str + "】," + exception.ToString();
            return(null);
        }
    }
Ejemplo n.º 5
0
    public static ArrayList query_qq_item(string qq, string groupid, string cookie)
    {
        string    str     = smethod_2(cookie);
        string    str2    = "http://qun.qzone.qq.com/cgi-bin/get_group_member?callbackFun=_GroupMember&uin={qq}&groupid={groupid}&neednum=1&r=0.8628084792289883&g_tk={gtk}&ua=Mozilla%2F5.0%20(Windows%20NT%206.1%3B%20WOW64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F31.0.1650.63%20Safari%2F537.36";
        string    address = str2.Replace("{qq}", qq).Replace("{groupid}", groupid).Replace("{gtk}", str + "");
        WebClient client  = new WebClient();

        client.Headers.Add("Accept", "*/*");
        client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
        client.Headers.Add("Referer", "http://qun.qzone.qq.com/group");
        client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
        client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
        client.Headers.Add("Cookie", cookie);
        string str4 = "";

        byte[] buffer = client.DownloadData(address);
        string str5   = client.ResponseHeaders["Content-Encoding"];

        if ("gzip".Equals(str5))
        {
            str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
        }
        else
        {
            str4 = Encoding.UTF8.GetString(buffer);
        }
        ArrayList list = new ArrayList();

        for (int i = 0; (i = str4.IndexOf("\"iscreator\":", i)) != -1; i++)
        {
            QQItem qq_item = new QQItem();
            qq_item.iscreator = int.Parse(StringUtil.subString(str4, i, "\"iscreator\":", ","));
            qq_item.ismanager = int.Parse(StringUtil.subString(str4, i, "\"ismanager\":", ","));
            qq_item.nick      = StringUtil.subString(str4, i, "\"nick\":\"", "\",\"").Trim();
            qq_item.uin       = StringUtil.subString(str4, i, "\"uin\":", "}");
            qq_item.ingrpnum  = 1;
            qq_item.string_2  = "0";
            list.Add(qq_item);
        }
        return(list);
    }
Ejemplo n.º 6
0
    public static ArrayList getQunList(string cookie)
    {
        string    str     = smethod_2(cookie);
        string    address = "http://qun.qq.com/cgi-bin/qun_mgr/get_group_list";
        WebClient client  = new WebClient();

        client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
        client.Headers.Add("Origin", "http://qun.qq.com");
        client.Headers.Add("X-Requested-With", "XMLHttpRequest");
        client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
        client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
        client.Headers.Add("Referer", "http://qun.qq.com/member.html");
        client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
        client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
        client.Headers.Add("Cookie", cookie);
        string str3 = "";

        byte[] buffer = client.UploadData(address, "POST", Encoding.UTF8.GetBytes("bkn=" + str));
        string str4   = client.ResponseHeaders["Content-Encoding"];

        if ("gzip".Equals(str4))
        {
            str3 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
        }
        else
        {
            str3 = Encoding.UTF8.GetString(buffer);
        }
        ArrayList list = new ArrayList();

        for (int i = 0; (i = str3.IndexOf("\"gc\":", i)) != -1; i++)
        {
            QQqun class2 = new QQqun();
            class2.num   = StringUtil.subString(str3, i, "\"gc\":", ",");
            class2.name  = StringUtil.subString(str3, i, "\"gn\":\"", "\",\"").Replace("&nbsp;", " ");
            class2.owner = StringUtil.subString(str3, i, "\"owner\":", "}");
            list.Add(class2);
        }
        return(list);
    }
Ejemplo n.º 7
0
    public static string code_url(CmsForm cmsForm, string url, string cookie)
    {
        try
        {
            WebClient client = new WebClient();
            client.Headers.Clear();
            client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
            client.Headers.Add("X-Requested-With", "XMLHttpRequest");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            client.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm");
            client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
            client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
            client.Headers.Add("Cookie", cookie);
            string str4   = "";
            byte[] buffer = client.DownloadData(url);
            string str5   = client.ResponseHeaders["Content-Encoding"];
            if ("gzip".Equals(str5))
            {
                str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
            }
            else
            {
                str4 = Encoding.UTF8.GetString(buffer);
            }

            if (str4.Contains("\"url\":\"http"))
            {
                string code_url = StringUtil.subString(str4, 0, "\"url\":\"", "\"");

                return(code_url);
            }
            return("");
        }
        catch (Exception exception)
        {
            return("");
        }
    }
Ejemplo n.º 8
0
 public static bool check_code(CmsForm cmsForm, string img_code, string sessionid, string taoke_cookie)
 {
     try
     {
         WebClient client = new WebClient();
         client.Headers.Clear();
         client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
         client.Headers.Add("X-Requested-With", "XMLHttpRequest");
         client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
         client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
         client.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm");
         client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
         client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
         client.Headers.Add("Cookie", taoke_cookie);
         string str2    = "http://pin.aliyun.com/check_img?code={img_code}&identity=sm-union-pub&sessionid={sessionid}&delflag=0&type=default";
         string address = str2.Replace("{img_code}", img_code).Replace("{sessionid}", sessionid);
         string str4    = "";
         byte[] buffer  = client.DownloadData(address);
         string str5    = client.ResponseHeaders["Content-Encoding"];
         if ("gzip".Equals(str5))
         {
             str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
         }
         else
         {
             str4 = Encoding.UTF8.GetString(buffer);
         }
         if (str4.Contains("\"message\":\"SUCCESS"))
         {
             return(true);
         }
         return(false);
     }
     catch (Exception exception)
     {
         return(false);
     }
 }
Ejemplo n.º 9
0
    public static bool smethod_0(string string_1)
    {
        string str = "";

        Directory.GetCurrentDirectory();
        string    address = "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm";
        WebClient client  = new WebClient();

        client.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
        client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
        client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
        client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
        client.Headers.Add("Cookie", string_1);
        byte[] buffer = client.DownloadData(address);
        string str3   = client.ResponseHeaders["Content-Encoding"];

        if ("gzip".Equals(str3))
        {
            return(GzipUtil.zip_to_string(buffer, Encoding.GetEncoding("GB2312")).Contains("<title>已买到的宝贝</title>"));
        }
        str = Encoding.GetEncoding("GB2312").GetString(buffer);
        return(false);
    }
Ejemplo n.º 10
0
    public static ArrayList smethod_2(string string_1)
    {
        string    str    = "https://qing.taobao.com/json/tg/ajaxGetItemsV2.json?type=0&salesSite=3&platformIds=34033%2C34032&timeFilter=now&stype=rank0&psize=100&page={pageno}&callback=jsonp48";
        WebClient client = new WebClient();

        client.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
        client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
        client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
        client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
        client.Headers.Add("X-Requested-With", "XMLHttpRequest");
        client.Headers.Add("Referer", "https://qing.taobao.com");
        client.Headers.Add("Cookie", string_1);
        ArrayList list = new ArrayList();
        int       num2 = 1;

        while (true)
        {
            string address = str.Replace("{pageno}", num2 + "");
            string str2    = GzipUtil.zip_to_string(client.DownloadData(address), Encoding.UTF8);
            for (int i = 0; (i = str2.IndexOf("\"baseinfo\"", i)) != -1; i++)
            {
                GoodsItem1 class2 = new GoodsItem1();
                class2.num_iid     = StringUtil.subString(str2, i, "\"itemId\":", ",");
                class2.title       = StringUtil.subString(str2, i, "\"title\":\"", "\"");
                class2.user_num_id = StringUtil.subString(str2, i, "\"sellerId\":", ",");
                class2.price       = StringUtil.subString(str2, i, "\"actPrice\":\"", "\"");
                list.Add(class2);
            }
            string s = StringUtil.subString(str2, 0, "\"totalPage\":", ",");
            if (num2 >= int.Parse(s))
            {
                return(list);
            }
            num2++;
        }
    }
Ejemplo n.º 11
0
    public static CouponItem get_coupon(string coupon_url, String num_iid, String pid, out string money)
    {
        money = "";
        CouponItem class2 = null;

        if (!(coupon_url.Contains("coupon") && coupon_url.Contains("taobao.com")))
        {
            coupon_url = get_redirect_url(coupon_url, coupon_url);
        }
        coupon_url = HttpUtility.UrlDecode(coupon_url);
        coupon_url = coupon_url.Replace("seller_id=", "sellerId=").Replace("activity_id=", "activityId=");
        string seller_id   = StringUtil.subString(coupon_url, 0, "sellerId=", "&");
        string activity_id = StringUtil.subString(coupon_url, 0, "activityId=", "&");

        if (!string.IsNullOrEmpty(seller_id) &&
            !string.IsNullOrEmpty(activity_id) &&
            !string.IsNullOrEmpty(num_iid) &&
            !string.IsNullOrEmpty(pid))
        {
            class2 = new CouponItem();
            string out_log;
            string ctoken = AlimamaUtil.smethod_61(activity_id, num_iid, pid, "1", out out_log);
            string str1   = AlimamaUtil.smethod_62(ctoken, activity_id, num_iid, pid, "1", out out_log, out money);
            try
            {
                class2.money     = (int)double.Parse(money);
                class2.leftCount = 100000;
            }
            catch
            {
                class2.money = 0;
            }
            return(class2);
        }

        string    str3    = "http://shop.m.taobao.com/shop/coupon.htm?seller_id={seller_id}&activity_id={activity_id}";
        string    address = str3.Replace("{seller_id}", seller_id).Replace("{activity_id}", activity_id);
        WebClient client  = new WebClient();

        client.Headers.Add("user-agent", "Mozilla/5.0 (iPad; U; CPU OS 3_2_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B500 Safari/531.21.10");
        byte[] buffer = client.DownloadData(address);
        string str5   = "";
        string str6   = client.ResponseHeaders["Content-Encoding"];

        if ("gzip".Equals(str6))
        {
            str5 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
        }
        else
        {
            str5 = Encoding.UTF8.GetString(buffer);
        }
        class2 = new CouponItem();
        if (!str5.Contains("该优惠券不存在或者已经过期"))
        {
            int index  = str5.IndexOf("元优惠券");
            int length = 1;
            while (regex_0.IsMatch(str5.Substring(index - length, length)))
            {
                length++;
            }
            length--;
            try
            {
                class2.money = int.Parse(str5.Substring(index - length, length));
            }
            catch
            {
                class2.money = 0;
            }
            try
            {
                class2.leftCount = int.Parse(StringUtil.subString(str5, 0, "<span class=\"rest\">", "</span>"));
            }
            catch
            {
                class2.leftCount = 0;
            }
            try
            {
                class2.receiveCount = int.Parse(StringUtil.subString(str5, 0, "<span class=\"count\">", "</span>"));
            }
            catch
            {
                class2.receiveCount = 0;
            }
            class2.endTime = StringUtil.subString(str5, 0, "<dd>有效期:", "</dd>");
        }
        return(class2);
    }
Ejemplo n.º 12
0
    public static string submit_query_code(CmsForm cmsForm, AlimamaQueryBean alimamaQueryBean, string img_code, string taoke_cookie)
    {
        try
        {
            WebClient client = new WebClient();
            client.Headers.Clear();
            client.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
            client.Headers.Add("X-Requested-With", "XMLHttpRequest");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            client.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm");
            client.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
            client.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
            client.Headers.Add("Cookie", taoke_cookie);
            string str2 = "http://pub.alimama.com/__x5__/query.htm?action={action}"
                          + "&event_submit_do_unique={event_submit_do_unique}"
                          + "&smPolicy={smPolicy}"
                          + "&smApp={smApp}"
                          + "&smReturn={smReturn}"
                          + "&smCharset={smCharset}"
                          + "&smTag={smTag}"
                          + "&captcha={captcha}"
                          + "&smSign={smSign}"
                          + "&ua=116UW5TcyMNYQwiAiwQRHhBfEF8QXtHcklnMWc%3D%7CUm5Ockt%2FRX9CdkN3T3dJdCI%3D%7CU2xMHDJoMnoBZhhiD3RaelRtQ2NNCmMIJnAm%7CVGhXd1llXGhSaFVhVGBYYF9jVGlLcE1zTXFLf0RwRX5Dfkd8R2k%2F%7CVWldfS0TMww1DCwSMhxzDlN9K30%3D%7CVmhIGCcZOQQkGCcdKQk1AT4eIh0oFTUAPQAgHCMWKwsxDjFnMQ%3D%3D%7CV25OHjAePgE5DCwQKBU1DjAINWM1%7CWGFBET8RMQ42AyMfIBs7ATkBOmw6%7CWWBAED4QMAwxCDwcIB4%2BAT4DPgI5bzk%3D%7CWmNDEz0TMwYzCCgULBg4AD0INgs3YTc%3D%7CW2NDEz0TM2NZbVNzR3MlBToaNBo6Aj8KMQwzZTM%3D%7CXGVFFTsVNQ81ASEdIRg4Aj8HPgE6bDo%3D%7CXWVFFTsVNWVeZlx8QHhGEDAPLwEvDzMNOQA%2BCjRiNA%3D%3D%7CXmZGFjh4LGUCbgNAJl8jXnBQADwDPx8jHiJ0VGlJZ0lpVWxRbFBlUQdR%7CX2REFDp6LmcAbAFCJF0hXHJSalFxTGxQaVRoUWxZD1k%3D%7CQHtbCyVlMXgfcx5dO0I%2BQ21NdU5uU3NPdkt3T3dIHkg%3D%7CQXpaCiRkMHkech9cOkM%2FQmxMdE9vUnJOd0p2Q3ZNG00%3D%7CQnlZCSdnM3odcRxfOUA8QW9Pd0xsUXFNdEl2S3NLHUs%3D%7CQ3tbCyVlMUs3XThZJAoqekF6WmZfaz0dIAAuACAcJRskHCUaTBo%3D%7CRHxcDCJiNn8YdBlaPEU5RGpKGi8XNws2A1V1SGhGaEh0TXRAfkN5L3k%3D%7CRX1dDSNjN34ZdRhbPUQ4RWtLGy4WNgo3AlR0SWlHaUl1THVBeEx1I3U%3D%7CRn1dDSNjN34ZdRhbPUQ4RWtLfl5jQ39GfEd7T3UjdQ%3D%3D%7CR35Dfl5jQ3xcYFllRXtDeVlgQHxBYVV1QGBaekZ%2BXmZGekRkWGdHeEdnWGREe0ZmWm5OdFRvT3dXa1MF"
                          + "&identity={identity}"
                          + "&code={code}"
                          + "&_ksTS={_ksTS}&callback=jsonp91";

            string address = str2
                             .Replace("{action}", alimamaQueryBean.action)
                             .Replace("{event_submit_do_unique}", alimamaQueryBean.event_submit_do_unique)
                             .Replace("{smPolicy}", alimamaQueryBean.smPolicy)
                             .Replace("{smApp}", alimamaQueryBean.smApp)
                             .Replace("{smReturn}", HttpUtility.UrlEncode(alimamaQueryBean.smReturn))
                             .Replace("{smCharset}", alimamaQueryBean.smCharset)
                             .Replace("{smTag}", HttpUtility.UrlEncode(alimamaQueryBean.smTag))

                             .Replace("{captcha}", HttpUtility.UrlEncode(alimamaQueryBean.captcha))
                             .Replace("{smSign}", HttpUtility.UrlEncode(alimamaQueryBean.smSign))

                             .Replace("{ua}", "")
                             .Replace("{identity}", alimamaQueryBean.identity)
                             .Replace("{_ksTS}", "")
                             .Replace("{code}", img_code)
            ;
            string str4   = "";
            byte[] buffer = client.DownloadData(address);
            string str5   = client.ResponseHeaders["Content-Encoding"];
            if ("gzip".Equals(str5))
            {
                str4 = GzipUtil.zip_to_string(buffer, Encoding.UTF8);
            }
            else
            {
                str4 = Encoding.UTF8.GetString(buffer);
            }
            //LogUtil.log_cms_call(cmsForm, "queryToken:" + str4);
            if (str4.Contains("\"queryToken\""))
            {
                string code_url = StringUtil.subString(str4, 0, "\"queryToken\":\"", "\"");
                return(code_url);
            }
            return("");
        }
        catch (Exception exception)
        {
            return("");
        }
    }