idhttp的post问题。
我需要做一个注册账号的软件。
PS:是公司要求的,不是做挂什么的,请大家不要误会。
我是使用idhttp来做的
procedure TForm1.Button1Click(Sender: TObject);
var
ms: TMemoryStream;
png:TdxPNGImage;
begin
ms:=TMemoryStream.Create;
png:=TdxPNGImage.Create;
IdHTTP1.Get('http://www.jxds.gov.cn/wssw/jsp/includes/zcyzm.jsp',ms);
ms.Position := 0;
png.LoadFromStream(ms);
Image1.Picture.Assign(png);
end;
目前验证码是能成功提取到了。
而post,也通过httpwatch抓到了,但是本人对这方面的编程借进与小白- -
这是httpwatch抓到的Post data 中的xml文件
<?xml version="1.0" encoding="GBK"?><rootVo ><head></head><properties><cell name="email" value="" /><cell name="fax" value="" /><cell name="frdb" value="?" /><cell name="mobile" value="" /><cell name="nsrglm" value="01010010" /><cell name="password" value="111111" /><cell name="password_answer" value="4444444444444" /><cell name="password_question" value="3333333333333" /><cell name="register_bsr_no" value="" /><cell name="register_id_no" value="" /><cell name="register_is_bsr" value="N" /><cell name="register_name" value="?" /><cell name="sex" value="0" /><cell name="taxregcode" value="123132132132" /><cell name="tel" value="" /><cell name="yzm" value="4177" /></properties></rootVo>
str:=TStringList.Create;
XML1:=TXMLDocument.Create(nil);
XML1.LoadFromFile('xml.XML');
str.Add(XML1.XML.Text);
IdHTTP1.Post('http://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);
showmessage(UTF8Decode(str1.DataString));
str:=TStringList.Create;
str1:=TStringStream.Create('');
str.Add('rootVo.properties*nsrglm='+'11111111');
str.Add('rootVo.properties*taxregcode='+'36111111111101');
str.Add('rootVo.properties*frdb='+'颜德');
str.Add('rootVo.properties*register_name='+'颜德');
str.Add('rootVo.properties*password='+'111111');
str.Add('passwordConfirm='+'111111');
str.Add('rootVo.properties*password_question='+'123456');
str.Add('rootVo.properties*password_answer='+'123456');
str.Add('rootVo.properties*yzm='+Edit1.Text);
IdHTTP1.Post('http://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);
showmessage(UTF8Decode(str1.DataString));
str:=TStringList.Create;
str.Add('nsrglm='+'11111111');
str.Add('taxregcode='+'36111111111101');
str.Add('frdb='+'颜德');
str.Add('register_name='+'颜德');
str.Add('password='+'111111');
str.Add('passwordConfirm='+'111111');
str.Add('password_question='+'123456');
str.Add('password_answer='+'123456');
str.Add('yzm='+Edit1.Text);
IdHTTP1.Post('http://www.jxds.gov.cn/wssw/sbController.do?cmd=glfw_qy_zc',str,str1);
showmessage(UTF8Decode(str1.DataString));