Autor Beitrag
huuuuuh
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Mo 17.03.08 20:23 
hab mal eine frage wie lädt man sich mit delphi eine datei herunterr und speichert diese im ordner in dem auch die .exe is?
mfg huuuuuh
DHE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Win XP, Ubuntu 9.04
Delphi 7 PE; Delphi 2010 Prof (Dank AGS 2009 ;-) )
BeitragVerfasst: Mo 17.03.08 20:30 
Zitat:
wie lädt man sich mit delphi eine datei herunter


Such mal hier im Forum nach URLDownloadToFile();

Zitat:
und speichert diese im ordner in dem auch die .exe is


in dem du den Pfad des Programms herausbekommst, das geht ganz einfach mit

ausblenden Delphi-Quelltext
1:
LocalPath := ExtractFileDir(Application.ExeName);					


wobei LocalPath eine ganz normale String-Variable ist


Zuletzt bearbeitet von DHE am Mo 17.03.08 20:31, insgesamt 1-mal bearbeitet
GrubenPete
Hält's aus hier
Beiträge: 10

Windows 7 32bit, Windows XP 32bit, Windows 200032bit, Ubuntu 32bit, openSuSe 10.3
Delphi 7 Pers., Turbo Delphi
BeitragVerfasst: Mo 17.03.08 20:31 
Der Ordner in dem sich die Anwendung befindet erhältst du mit ExtractFilePath(ParamStr(0));
Zum Runterladen würd ich mir mal von den Indys TIdHTTP.Get angucken.

MfG. Sascha
DHE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Win XP, Ubuntu 9.04
Delphi 7 PE; Delphi 2010 Prof (Dank AGS 2009 ;-) )
BeitragVerfasst: Mo 17.03.08 20:33 
Für kleine Dateuen wie Bilder oder Dokumente reicht URLDownloadToFile(); völlig aus, zumal man dafür keine Komponente benötigt, ist die Datei Größer bietet sich eher die Variante von GrubenPete an.
huuuuuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 665
Erhaltene Danke: 19

win xp, (win vista), win 7
VS 2008 Express Edition, VS 2010 Express Edition, VS 2010 Professionell
BeitragVerfasst: Mo 17.03.08 20:49 
ich mach das jetz so wie GrubenPete es vorgeschlagen hat.
aber was kann ich dagegen tun dass sich dass programm beim download "aufhängt"?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 17.03.08 21:13 
Moin!

user profile iconhuuuuuh hat folgendes geschrieben:
aber was kann ich dagegen tun dass sich dass programm beim download "aufhängt"?
Das Programm verarbeitet nur keine Nachrichten, da es mit dem Download beschäftigt ist. ;) Du musst den Download in einen eigenen Suche in: Delphi-Forum, Delphi-Library THREAD auslagern, wenn die Oberfläche nicht blockieren soll. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
GrubenPete
Hält's aus hier
Beiträge: 10

Windows 7 32bit, Windows XP 32bit, Windows 200032bit, Ubuntu 32bit, openSuSe 10.3
Delphi 7 Pers., Turbo Delphi
BeitragVerfasst: Mo 17.03.08 21:39 
Oder du probierst mal die TIdAntiFreeze auch bei den Indys dabei und zu finden unter 'Misc' (glaub ich zumindest)
Aktivieren und das Programm sollte theoretisch weiter die Messages bearbeiten.