post提交,淘宝可以登录,但是一淘网登录不了,抓包的时候发现,一淘也是先登录淘宝,然后跳转到www.etao.com的页面。
但是试了好久都没成功,想请问大家,问题出在哪里?有类似经验的人,请帮忙,谢谢大侠了!POST的数据是下面这些:
TPL_username="+username+"&TPL_password="+password+"&TPL_checkcode=&need_check_code=&_tb_token_=fe47e363575bb&action=Authenticator&event_submit_do_login=anything&TPL_redirect_url=http%3A%2F%2Flogin.etao.com%2Floginmid.html%3Fredirect_url%3Dhttp%3A%2F%2Fwww.etao.com&from=etao&fc=2&style=miniall&css_style=etao&tid=XOR_1_000000000000000000000000000000_63584452460B0D7879007170&support=000001&CtrlVersion=1%2C0%2C0%2C7&loginType=3&minititle=&minipara=&umto=T4710c9478ad11b5adbb5c6d7ee7893e4%2C200&pstrong=2&llnick=&sign=&need_sign=&isIgnore=&full_redirect=&popid=&callback=&guf=&not_duplite_str=&need_user_id=&poy=&gvfdcname=10&gvfdcre=&from_encoding=下面是抓包的截图
 CookieContainer mycookie = new CookieContainer();HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
            myRequest.CookieContainer = mycookie;
            myRequest.Method="POST";
            myRequest.ContentType="application/x-www-form-urlencoded";
            myRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windorews NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E)";
            myRequest.KeepAlive = true;
            byte[] postBytes = Encoding.Default.GetBytes(postStr);
            myRequest.ContentLength = postBytes.Length;            using (Stream requestStream = myRequest.GetRequestStream())
            {
                requestStream.Write(postBytes, 0, postBytes.Length);
                using (HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse())
                {
                    using (Stream responseStream = myResponse.GetResponseStream())
                    {
                        using (StreamReader reader = new StreamReader(responseStream, Encoding.GetEncoding("GB2312")))
                        {
                            mycc.Add(myResponse.Cookies);
                            string outdata = reader.ReadToEnd();
                            return outdata;
                        }
                    }
                }
            }

解决方案 »

  1.   

    umto=T4710c9478ad11b5adbb5c6d7ee7893e4 仔细找找类似这样的数据 都是需要从页面抓取了在POST过去 
      

  2.   


    整个POST就这个umto,没有别的了,不太了解您说的什么意思,能帮帮忙吗?谢谢了
      

  3.   


    请求一淘网时的Response.Cookies个属性count个数为0,是怎么回事?
      

  4.   

    跨域了,请求etao.com时把cookie手动给下.
      

  5.   


    具体是在request.cookies,还是response.cookies这边,菜鸟不懂,希望大侠多多指教下
    或者是大概给个操作的伪代码,谢谢了
      

  6.   


    不好意思,白天有事,如果可以的话,你把代码发给我[email protected],我给看下,
    ps:我不是大侠哦.
      

  7.   


    楼主解决了么,这个umto什么意思啊?