如何用Idhttp登录网站? ( 积分: 100 )

S

SPEAKER

Unregistered / Unconfirmed
GUEST, unregistred user!
如何用Idhttp登录这个网站:www.ogame.com.cn
急啊!
我用Idhttp.post试了,根本进不去,一提交信息就跳转会登录页面。
代码片断:
IdHttp1.AllowCookies:=True;
IdHTTP1.Request.Accept:='image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*';
IdHTTP1.Request.Referer :='http://uni2.ogame.com.cn/game/reg/login2.php';
IdHTTP1.Request.AcceptLanguage:='zh-cn';
IdHTTP1.Request.AcceptEncoding:='gzip, deflate'; //gzip, deflate
IdHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)';
IdHTTP1.Request.Host:='uni2.ogame.com.cn';
IdHTTP1.Request.ContentLength:=80;
IdHTTP1.Request.Connection:=' Keep-Alive';
IdHTTP1.Request.CacheControl:='no-cache';
IdHTTP1.HandleRedirects:=True;
IdHTTP1.Request.ContentType:='application/x-www-form-urlencoded';
 
我也遇见这个问题了。
然后,我想用WebBrowser登陆后再用IDhttp登陆。
可是还是没有成功[:(]
 
拿个嗅探软件先探一下WebBrowser Post的数据啊,然后用IdHTTP模拟,只要你探到了数据,一比对就知道哪里有问题了。改正就好了。
 
问题是根据嗅探数据修改后还是错啊
 
IdHTTP1.HandleRedirects:=true;
加了后照说不会有跳转错误啦..真晕
 
顶部