怎样用 IdHttp 登录网站?
为管理网站的方便,想使用 IdHTTP 登录网站,抓包数据如下:
POST /login.asp?action=login_chk
HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,*/*
Referer: http://www.celiang.net/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; MyIE9)
Host: www.celiang.net
Content-Length: 65
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASPSESSIONIDASBCDQAB=EKFALHMCGBNFHICIPAOFOJHB
re_log=yes
&username=用户名
&password=密码
&memery_info=yes
查阅了网上的一些资料,结果试验后都不成功,非常郁闷!
要登录的网站是这个:http://www.celiang.net/login.asp
下面是自己的代码:
IdHTTP1->Request->Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,*/*";
IdHTTP1->Request->Referer = "http://www.celiang.net/";
IdHTTP1->Request->AcceptLanguage = "zh-cn";
IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded";
IdHTTP1->Request->AcceptEncoding = "gzip, deflate";
IdHTTP1->Request->UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; MyIE9)";
IdHTTP1->Request->Host = "www.celiang.net";
IdHTTP1->Request->ContentLength = 65;
IdHTTP1->Request->Connection = "Keep-Alive";
IdHTTP1->Request->CacheControl = "no-cache";
//IdHTTP1->Request->
TStringStream *Param = new TStringStream(NULL);
TStringStream *RStream = new TStringStream(NULL);
Param->WriteString("re_log=yes");
Param->WriteString("&username=用户名");
Param->WriteString("&password=密码");
Param->WriteString("&memery_info=yes");
IdHTTP1->Post("http://www.celiang.net/login.asp", Param, RStream);
Memo1->Text = RStream->DataString;
为什么不行呢?请高手指点!
POST /login.asp?action=login_chk
HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,*/*
Referer: http://www.celiang.net/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; MyIE9)
Host: www.celiang.net
Content-Length: 65
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASPSESSIONIDASBCDQAB=EKFALHMCGBNFHICIPAOFOJHB
re_log=yes
&username=用户名
&password=密码
&memery_info=yes
查阅了网上的一些资料,结果试验后都不成功,非常郁闷!
要登录的网站是这个:http://www.celiang.net/login.asp
下面是自己的代码:
IdHTTP1->Request->Accept = "image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,*/*";
IdHTTP1->Request->Referer = "http://www.celiang.net/";
IdHTTP1->Request->AcceptLanguage = "zh-cn";
IdHTTP1->Request->ContentType = "application/x-www-form-urlencoded";
IdHTTP1->Request->AcceptEncoding = "gzip, deflate";
IdHTTP1->Request->UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; MyIE9)";
IdHTTP1->Request->Host = "www.celiang.net";
IdHTTP1->Request->ContentLength = 65;
IdHTTP1->Request->Connection = "Keep-Alive";
IdHTTP1->Request->CacheControl = "no-cache";
//IdHTTP1->Request->
TStringStream *Param = new TStringStream(NULL);
TStringStream *RStream = new TStringStream(NULL);
Param->WriteString("re_log=yes");
Param->WriteString("&username=用户名");
Param->WriteString("&password=密码");
Param->WriteString("&memery_info=yes");
IdHTTP1->Post("http://www.celiang.net/login.asp", Param, RStream);
Memo1->Text = RStream->DataString;
为什么不行呢?请高手指点!
...全文
相关推荐
IDHTTP网站登陆源代码(DELPHI)
需要密码,用户名,和验证码的,我搞了三天才成功,成功了后的返回页面反我给激动得呀,里面是我几天的成果,各位下载后改成其他网站的嘛,我是为了做外挂才学这个的,因此,这是最基本的!看了后保证你不后悔
火神网站登录
模拟登陆火神网站,可以用WEBBROWSER或者IDHTTP来登陆
自动登录 (Delphi2010 原创)
前几天研究网站登录做的一个DEMO,验证码采用图片显示输入,用的是DELPHI2010,indy10.5.5,控件IdHTTP。关于验证码的破解正在研究中。用于学习IdHttp非常好
实现模拟登陆系统平台
模拟实现网络登陆,采用idhttp post 方法
Delphi 线程池批量操作
利用线程池可以批量,进行批量IDHTTP操作,比如账号批量登录某网站,也可以选中某些账号进行,线程池代码来自老外,本人稍微修改而已


网络及通讯开发
