Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
FileList := TStringList.Create;
try
FileList.Add('http://www.michael-puff.de/Programmierung/Delphi/Programme/AdressDB.zip');
FileList.Add('http://www.michael-puff.de/Programmierung/Delphi/Programme/AdressDB_nonVCL.zip');
FileList.Add('kdvndk');
FileList.Add('http://www.michael-puff.de/Programmierung/Delphi/Programme/AudioPlayer.zip');
for i := 0 to FileList.Count - 1 do
begin
try
Download(i);
except
on E: EIdReadTimeOut do
begin
Memo1.Lines.Add(E.Message);
Continue;
end;
end;
end;
finally
FileList.Free
end;
end;
procedure TForm1.Download(index: Integer);
begin
IdHTTP1.Head(FileList[index]);
Memo1.Lines.Add(IntToStr(IdHTTP1.Response.ContentLength));
end;
Just to show you the main principle.