Autor Beitrag
Delphi Champ 3
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 3.11, Win 95, Win ME, Win XP, Multiubuntu
Delphi 3, Turbo Delphi Explorer 2006
BeitragVerfasst: Mo 19.11.07 18:19 
Hallo,
ich würde gerne mit Hilfe von Delphi, von meinem Webserver Daten lesen und evtl. auch welche raufschreiben. Ich möchte so zum Beispiel gucken, ob schon eine neue Version von meinem Programm im Internet ist und die dann downloaden. Ich möchte allerdings mich nicht beim FTP-Server einloggen, da mein Programm das Passwort nicht kennen soll. ;)
Ich würde denn das Atribut von der entsprechenden Seite auf schreib- und lesbar stellen.
Ich habe einfach mal folgendes probiert. (Bitte nicht lachen :oops: )
ausblenden Delphi-Quelltext
1:
Memo1.Lines.LoadFromFile('http://www.mein-server.de/meine-datei.txt');					

Der Computer kehrt allerdings die Slashs in Backslashs um und sucht die Datei lokal auf meiner Festplatte unter C:\...\http:\www.mein-server.de\meine-datei.txt und da gibt es natürlich keine Datei.

Kann mir vielleicht jmd. weiter helfen und mir eine Möglichkeit geben? Oder vielleicht auch eine bessere als mein Gedankengang?

Danke! :D
Delphi Champ 3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 3.11, Win 95, Win ME, Win XP, Multiubuntu
Delphi 3, Turbo Delphi Explorer 2006
BeitragVerfasst: Mo 19.11.07 20:46 
Ich habe jetzt schon was über die Suche gefunden:
URLDownloadToFile() und InternetReadFile(), nur ich weiß nicht welche Parameter ich angeben muss. Kann mir das jmd erklären?

Danke :D
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 20.11.07 18:10 
Moin!

Da das API-Funktionen sind, schonmal ins MSDN geschaut? ;)
Suche im MSDN URLDOWNLOADTOFILE
Suche im MSDN INTERNETREADFILE

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Delphi Champ 3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 3.11, Win 95, Win ME, Win XP, Multiubuntu
Delphi 3, Turbo Delphi Explorer 2006
BeitragVerfasst: Di 20.11.07 21:45 
So richtig werde ich daraus nicht schlau. Kann mir vielleicht jmd in deutsch sagen, was ich da genau eintragen muss? Ich weiß nicht, was bei den ganzen Pointern rein soll. :roll:

Vielen Dank :D
Calculon
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 676

Win XP Professional
Delphi 7 PE, Delphi 3 PRO
BeitragVerfasst: Mi 21.11.07 09:18 
ungetestet:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  source, target: string;
begin
  source := 'http://www.mein-server.de/meine-datei.txt';
  target := 'C:\Download\meine-datei.txt';
  URLDownloadToFile(Nil, PChar(source),PChar(target), 0Nil);
  // erfolgreich? wenn ja
  Memo1.Lines.LoadFromFile(target);
end;
Delphi Champ 3 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

Win 3.11, Win 95, Win ME, Win XP, Multiubuntu
Delphi 3, Turbo Delphi Explorer 2006
BeitragVerfasst: Mi 21.11.07 20:31 
Prima Danke! Funktioniert! :D

Und InternetReadFile()?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 22.11.07 03:57 

_________________
There are 10 types of people - those who understand binary and those who don´t.