Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Download (https://www.delphipraxis.net/21707-download.html)

faux 6. Mai 2004 19:07


Download
 
Hallo!

Ich würde gerne eine Downloadfunktion in mein Programm integrieren. Der Server ist im Internet also kein anderer PC sondern eine freizugängliche http Seite.
Jedenfalls will ich, dass in einer TStatusBar der Downloadstatus angezeigt wird.

Wie kann ich...
1. ...sowas überhaupt realisieren?
2. ...die StatusBar für den Downloadstatus benutzen?

Danke schon mal...

a.vollmer 6. Mai 2004 19:11

Re: Download
 
Delphi-Quellcode:
//zweite Möglichkeit, Download in eine Datei (mit Fortschritsanzeige)

procedure TForm1.Button1Click(Sender: TObject);
var Datei: TFIleStream;
begin
  Datei:=TFileStream.create('C:\datei.exe',fmCreate);
  IdHttp1.Get('http://www.domain.de/datei.exe',Datei);
  Datei.free;
end;

procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
  const AWorkCount: Integer);
begin
Label1.Caption:=idHttp1.url.Document+' ('+inttostr(AWorkCount div 1024)+' kB von '+inttostr(IdHTTP1.Response.ContentStream.Size div 1024)+' kB)';
Progressbar1.Position:=AWorkCount*100 div IdHTTP1.Response.ContentStream.Size;
application.ProcessMessages;
end;
Quelle: Delphi-Netzwerk.de Code Library

Gruß

Alex

Meflin 7. Mai 2004 14:51

Re: Download
 
auch in der dp code library ist ein code dazu...


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:12 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