Unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
stream: TFileStream;
stream1, stream2: TMemoryStream;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/1.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/2.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/3.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/4.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/5.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
try
stream := TFileStream.Create('
c:\temp', fmCreate);
IdHTTP1.Get('
http://home.arcor.de/delphi_checker/testdl/6.gif', stream);
finally
stream.Free;
end;
try
stream1:=TMemoryStream.Create;
stream2:=TMemoryStream.Create;
stream1.LoadFromFile('
c:\temp');
stream2.LoadFromFile('
c:\final');
stream1.Position:=stream1.Size;
stream1.CopyFrom(stream2,0);
stream1.SaveToFile('
c:\final');
finally
stream2.Free;
stream1.Free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
stream := TFileStream.Create('
c:\final', fmCreate);
stream.Free;
end;
end.