http://member1.taobao.com/member/login.jhtml?TPL_username=用户名&TPL_password=密码&Submit=登 录&actionForStable=enable_post_user_action&action=Authenticator&TPL_redirect_url=&event_submit_do_login=anything&abtest=&pstrong=1&from=用这样的链接直接在IE的地址栏可以登陆,但用Idhttp.get 却登陆不了,不知道是为什么哦

解决方案 »

  1.   

    当然不行,要对登陆事件抓包,获取网页的登陆发送的包.然后自己组包 用idhttp.post发送上去
      

  2.   

    首先获取cookie在HTTP请求头加上COOKIE请求,再GET,跟下载CSDN上东西道理是一样的
      

  3.   

    我也在找这方面的答案,想取本地电脑的cookie中其他域的值
      

  4.   

    先 get 页面得到cookie,然后把cookie设置好再post。
      

  5.   

    哥们,这个问题,其他人问了,我给解决了,贴上代码,记得结贴散分unit Unit7;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,ComObj,IdHTTP;type
      TForm7 = class(TForm)
        Memo_Log: TMemo;
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        procedure MyRedirect(Sender: TObject; var dest: string; var NumRedirect: Integer; var Handled: boolean; var VMethod: TIdHTTPMethod);
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form7: TForm7;implementation{$R *.dfm}procedure TForm7.Button1Click(Sender: TObject);
    begin
    end;procedure TForm7.Button2Click(Sender: TObject);
    var
      PS:TStringList;
      RS,RS1:TStringStream;
      FHTTP:TIdHTTP;
    begin
      PS:=TStringList.Create;
      RS:=TStringStream.Create('');
      RS1:=TStringStream.Create('');
      FHTTP:=TIdHTTP.Create(nil);
      try
        FHTTP.HandleRedirects:=False;
        FHTTP.OnRedirect:=MyRedirect;
        FHTTP.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
        FHTTP.Request.ContentType:='application/x-www-form-urlencoded; Charset=UTF-8';
        FHTTP.Request.Host:='member1.taobao.com';
        FHTTP.Request.Connection:='Keep-Alive';
        FHTTP.Request.Accept:='*/*';
        PS.Add('TPL_username=用户名');
        PS.Add('CtrlVersion=1,0,0,7');
        PS.Add('support=000001');
        PS.Add('tid=加密后');
        PS.Add('TPL_password=加密后');
        PS.Add('actionForStable=enable_post_user_action');
        PS.Add('action=Authenticator');
        PS.Add('TPL_redirect_url=');
        PS.Add('event_submit_do_login=anything');
        PS.Add('abtest=');
        PS.Add('pstrong=');
        PS.Add('from=');
        PS.Add('yparam=');
        PS.Add('done=');
        FHTTP.Request.ContentLength:=Length(PS.Text);
        FHTTP.Post('http://member1.taobao.com/member/login.jhtml',PS,RS);
        FHTTP.Get('http://my.taobao.com/mytaobao/home/my_taobao.jhtml',RS1);
        Memo_Log.Text:=RS1.DataString;
      finally
        if Assigned(FHTTP) then FreeAndNil(FHTTP);
        if Assigned(PS) then FreeAndNil(PS);
        if Assigned(RS) then FreeAndNil(RS);
        if Assigned(RS1) then FreeAndNil(RS1);
      end;
    end;procedure TForm7.MyRedirect(Sender: TObject; var dest: string;
      var NumRedirect: Integer; var Handled: boolean; var VMethod: TIdHTTPMethod);
    begin
      Handled:=True;
    end;end.调试版本是Indy10.2.3,Delphi2007
      

  6.   

    哈哈,大师,你真厉害!
    我现在都是一直用GET的方法登陆的
      

  7.   

        PS.Add('tid=加密后');
        PS.Add('TPL_password=加密后');
    这个TID和TPL_password如何获取加密后的结果?