I want to make a program auto access this site http://ringzer0team.com/ Everything I need (user,pass,csfr) I have, but how to keep the HTTP - Connection in pascal? I used http://posttestserver.com/ to test the method post. Here is my code. When I check the login.html file . It says HTTP_CONNECTION = close So I wonder how to keep it on.
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,StdCtrls, httpsend,synacode;
procedure TForm1.Button2Click(Sender: TObject);
var
URL: string;
Params: string;
Response: TMemoryStream;
i:longint;
S:ansistring;
cs:string;
begin
httpClient:= THTTPSend.Create;
if httpClient.HTTPMethod('GET', 'http://ringzer0team.com/login') then
httpClient.Document.SaveToFile('1.txt');
httpClient.Free;
system.assign(fi,'1.txt');
reset(fi);
for i:=1 to 62 do readln(fi,S);
cs:=copy(S,21,32);
system.close(fi);
Response := TMemoryStream.Create;
try
URL := 'http://posttestserver.com/post.php?dump&html';
Params := 'username=' + EncodeURLElement('user') + '&' + 'password=' + EncodeURLElement('pass') + '&' + 'csrf=' + EncodeURLElement(cs);
system.assign(fi,'text');
if HttpPostURL(URL, Params, Response) then Response.SaveToFile('login.html');
finally
Response.Free;
end;
end;