加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

delphi:用idhttp连接到yahoo web messenger

发布时间:2020-12-15 09:11:54 所属栏目:大数据 来源:网络整理
导读:我使用delphi xe2并编写一个简单的代码来连接到yahoo web messenger 但是我得到了这个消息 If you are seeing this page,your browser settings prevent you from automatically redirecting to a new UR procedure TForm2.Button1Click(Sender: TObject);va
我使用delphi xe2并编写一个简单的代码来连接到yahoo web messenger
但是我得到了这个消息

If you are seeing this page,your browser settings prevent you from
automatically redirecting to a new UR

procedure TForm2.Button1Click(Sender: TObject);
var
idVar:TStringList;
Cookies:string;
begin
 idVar:=TStringList.Create; idVar.Clear;
 idVar.Add('.tries=1');
 idVar.Add('.src=vsu');
 idVar.Add('.md5=');
 idVar.Add('.hash=');
 idVar.Add('.js=');
 idVar.Add('.last=');
 idVar.Add('promo=');
 idVar.Add('.intl=us');
 idVar.Add('.bypass=');
 idVar.Add('.partner=');
 idVar.Add('.u=3p9b5hh7aiqbl');
 idVar.Add('.v=0');
 idVar.Add('.challenge=J5TQOMzQ9Sr5hwnIHYMiVyI2i1_M');
 idVar.Add('.yplus=');
 idVar.Add('.emailCode=');
 idVar.Add('pkg=');
 idVar.Add('stepid=');
 idVar.Add('.ev=');
 idVar.Add('hasMsgr=0');
 idVar.Add('.chkP=Y');
 idVar.Add('.done=http://webmessenger.yahoo.com/');
 idVar.Add('.pd=wmsgr_ver=0&c=B_VH9oa42e68KuzJEhSlKbE-&ivt=&sg=');
 idVar.Add('login='+edt1.Text);
 idVar.Add('passwd='+edt2.Text);
 idVar.Add('.persistent=y');
  Memo1.Text:=idhtp1.Post('https://login.yahoo.com/config/login?',idVar);
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
idhtp1.CookieManager:=idckmngr1;
idhtp1.IOHandler:=idslhndlrscktpnsl1;
idhtp1.RedirectMaximum:=5000;
idhtp1.Request.BasicAuthentication:=False;
idhtp1.HandleRedirects := True;

idslhndlrscktpnsl1.SSLOptions.Method:=sslvSSLv23;
idhtp1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)';
end;

procedure TForm2.idhtp1Redirect(Sender: TObject; var dest: string;
  var NumRedirect: Integer; var Handled: Boolean; var VMethod: string);
begin
Handled:=True;
end;

解决方法

If you are seeing this page,your browser settings prevent you from
automatically redirecting to a new URL.

这对于Fiddler来说是HTTP / 1.1 200 OK所以问题不在于重定向.

对我有用的只是在此消息出现后重复整个Button1Click并且我正确登录.在此期间收集的cookie是关键,因此您可以尝试仅发送一个请求,但预先设置了Cookie.或者,如果没有帮助,只需使用收集的cookie重复请求即可. TIdCookieManager救援!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读