Autor Beitrag
mrmaus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Do 10.11.05 11:36 
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
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
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;


Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.