Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Download in Schleife mit Verzögerung (https://www.delphipraxis.net/56733-download-schleife-mit-verzoegerung.html)

mrmaus 10. Nov 2005 09:18


Download in Schleife mit Verzögerung
 
Hallo,

ich habe folgendes Problem. Ich habe einen Downloadbatch mit Hilfe der Indy Komponenten erstellt. Dieser funktioniert auch. Doch wenn ich diesen Code in eine Schleife setze, also für mehrere Download in Folge, wird jede Datei nicht komplett runtergeladen sondern nur 25kb. Ich dachte mir es gäbe eine Möglichkeit eine Verzögerung in die SChleife einzubauen so dass jeder Download erst beendet wird bevor der nächste startet.

Danke

Hier der Code
[delphi]
begin
Form1.IdHTTP1.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
Form1.IdHTTP1.HandleRedirects := True;
Form1.IdHTTP1.RedirectMaximum := 15;
for int_count := 1 to 3 do begin
str_target := 'C:\test' + inttostr(int_count);
fst_Stream := TFileStream.Create(str_target, fmCreate or fmShareDenyNone);
try
fst_Stream.Position := 0;
Form1.IdHTTP1.Get('http://www.bsp.1.zip', fst_Stream);
except
On E: EIdHTTPProtocolException do
Showmessage('HTTP-Fehler: ' + IntToStr(E.ErrorCode));
end;
fst_Stream.Free;
end;
Statusbar1.SimpleText := 'Process complete';
end;

shmia 10. Nov 2005 09:27

Re: Download in Schleife mit Verzögerung
 
Ist dir schon aufgefallen, dass du 3 Mal die gleiche URL ('http://www.bsp.1.zip') downloadest ???

mrmaus 10. Nov 2005 09:30

Re: Download in Schleife mit Verzögerung
 
ja, selbstverständlich. ist doch nur zu testzwecken...


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:27 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz