unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
StdCtrls, IdMultipartFormData, IdServerIOHandler, IdSSL, IdSSLOpenSSL,
IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdServerIOHandlerSocket,
IdServerIOHandlerStack, IdIOHandlerStream, IdCookieManager ;
type
TForm2 =
class(TForm)
IdHTTP1: TIdHTTP;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Memo1: TMemo;
IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
data: TIdMultiPartFormDataStream;
begin
data := TIdMultiPartFormDataStream.Create;
try
{ add the used parameters for the script }
data.AddFormField('
login=', edit1.Text);
data.AddFormField('
password=', edit2.Text);
{ Call the Post method of TIdHTTP and read the result into TMemo }
Memo1.Lines.Text := IdHTTP1.Post('
https://ssl.rapidshare.com/premiumzone.html', data);
finally
data.Free;
end;
end;
var
IdHttpLoader: TIdHttp;
CookieManager: TIdCookieManager;
SSLIOHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create;
CookieManager := TIdCookieManager.Create;
IdHttpLoader := TIdHttp.Create;
try
IdHttpLoader.CookieManager := CookieManager;
IdHttpLoader.IOHandler := SSLIOHandler;
IdHttpLoader.HandleRedirects := True;
finally
IdHttpLoader.Free;
end;
end.