X
xxaal1
Unregistered / Unconfirmed
GUEST, unregistred user!
受朋友委托,做一程序,要求自动从网页上读取一些数据存入数据库。但必须先进行登陆,我用IDHTTP进行登陆,但无法实现。通过分析网页,发现网页对密码用calcMD5进行加密,我在程序中语句该如何写?网站地址:http://221.12.5.43。下面是我写的语句,希望各位朋友能提供帮助。
postURL:='http://221.12.5.43/Boss/index.jsp';
idhttp1.HTTPOptions :=[hoForceEncodeParams];
idHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
idhttp1.HandleRedirects :=true;
Fpost :=TstringList.create;
Fpost.Add('operator=XXXXX');
Fpost.Add('password=XXXXX');
Fpost.Add('inaddr=0.0.0.0');
Fpost.Add('hostname=151:7055');
Fpost.Add('inmac=00:192:68:74:65');
Fpost.Add('hasInterSerno=''''');
res := TstringStream.Create('');
try
idhttp1.post(postURL,Fpost,res);
finally
memo1.text:=Res.DataString;
res.Free;
end;
Fpost.free;
postURL:='http://221.12.5.43/Boss/index.jsp';
idhttp1.HTTPOptions :=[hoForceEncodeParams];
idHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
idhttp1.HandleRedirects :=true;
Fpost :=TstringList.create;
Fpost.Add('operator=XXXXX');
Fpost.Add('password=XXXXX');
Fpost.Add('inaddr=0.0.0.0');
Fpost.Add('hostname=151:7055');
Fpost.Add('inmac=00:192:68:74:65');
Fpost.Add('hasInterSerno=''''');
res := TstringStream.Create('');
try
idhttp1.post(postURL,Fpost,res);
finally
memo1.text:=Res.DataString;
res.Free;
end;
Fpost.free;