Autor Beitrag
0nk3lz
Hält's aus hier
Beiträge: 13

WinXP, WinVista

BeitragVerfasst: Do 09.04.09 12:01 
Hallöchen,
ich arbeite im Moment an einem "Downloader".
Ist es da möglich, dass man den Download auch gestartet bekommt, ohne dass der Browser geöffnet wird?
Wenn ja, wie?
MfG 0nk3lz


Zuletzt bearbeitet von 0nk3lz am Do 09.04.09 12:32, insgesamt 1-mal bearbeitet
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 09.04.09 12:12 

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
0nk3lz Threadstarter
Hält's aus hier
Beiträge: 13

WinXP, WinVista

BeitragVerfasst: Do 09.04.09 12:15 
OK, war ne blöde Frage :)
Aber wie geht es denn?^^ Könntest du mir das verraten? ;)
curtiss
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Do 09.04.09 12:21 
"Ja. Das geht." xD

herrlich
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 09.04.09 13:03 
Dir bieten sich zum Downloaden einer Datei eine ganze Reihe von Möglichkeiten. Eine geht mit Hilfe der Komponente IdHTTP, eine andere funktioniert über die Windows-API (genauen Namen müsst ich nachgucken). Weiterhin kannst Du auch immer noch mit Hilfe von Sockets das HTTP-Protokoll schnell selber implementieren und den DL dann auswerten. Kommt ganz drauf an, was Du genau tun willst. Nähere Infos zu all den genannten Möglichkeiten finden sich bereits zu Hauf hier im Forum ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 09.04.09 13:13 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
downloader: TidHttp;
fs: TFileStream;
begin
  fs := TFilestream.Create('C:\Zieldatei.dat');
  downloader := TIdHttp.Create;
  downloader.Get('http://blubb.de/datei.dat', fs);
  downloader.free;
  fs.free;
end;
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 09.04.09 13:41 
user profile iconAndreas L. hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
var
downloader: TidHttp;
fs: TFileStream;
begin
  fs := TFilestream.Create('C:\MeinVirus.exe');
  try
    downloader := TIdHttp.Create;
    try
      downloader.Get('http://blubb.de/datei.dat', fs);
    finally
      downloader.free;
    end;
  finally

    fs.free;
  end;
end;


Wenn schon, dann bitte richtig ;-)

Fehlt nur noch das Ausführen der Datei ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
0nk3lz Threadstarter
Hält's aus hier
Beiträge: 13

WinXP, WinVista

BeitragVerfasst: Do 09.04.09 14:10 
Danke für die Antworten ;)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 09.04.09 17:03 
Eine andere Möglichkeit bietet die Funktion URLDownloadToFile aus der Unit urlmon. Am besten mal danach suchen, wenn du eine Alternative sehen willst. Meines Wissens konnte man da auch eine Callback-Prozedur für eine Fortschrittsanzeige übergeben.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19276
Erhaltene Danke: 1741

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 09.04.09 17:10 
Er hat den Code schon kopiert und in der DP eine Folgefrage gestellt. (uses IdHttp fehlte ihm, und dem Create des FileStreams fehlte ein Parameter.)
Warum er das nicht gleich hier gefragt hat, frage ich mich allerdings... :roll: