5,388
社区成员
发帖
与我相关
我的任务
分享
var
stream: TStringStream;
s:string;
begin
EditURL.Text :='http://www.cppinfo.com/pdm/business/site/cip/siteAppNo.jsp';
with IdHTTP do
begin
Request.Accept := 'image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap,'
+ 'application/vnd.ms-xpsdocument, application/xaml+xml, application/x-silverlight, application/msword, */*';
Request.AcceptEncoding :='gzip, deflate';
Request.AcceptLanguage :='zh-cn';
Request.CacheControl :='no-cache';
Request.Connection :='Keep-Alive';
Request.ContentLength :=35;
Request.Host :='www.cppinfo.com';
Request.Referer :='http://www.cppinfo.com/pdm/business/site/cip/siteAppNo.jsp';
Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)';
Request.ContentType := 'application/x-www-form-urlencoded';
HandleRedirects := true;
AllowCookies :=true;
end;
stream:=TStringStream.Create('approveNo=2011075556&captchaNo='+edit2.Text);
try
try
s:=IdHTTP.Post(EditURL.Text, stream );
Memo1.Clear ;
Memo1.Lines.Add(s );
except
ShowMessage('login fail');
end;
finally
stream.Free ;
end;
end;
<FORM method=post name=cipForm target=_parent>