Autor Beitrag
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 13.12.03 15:38 
Hi,

ich würde gerne eine Funktion in mein Programm einbauen, die es dem Benutzer ermöglicht, herauszufinden, ob seine Version noch auf dem neuesten Stand ist oder ob es bereits eine neuere gibt.
Ich hätte mir das Ganze so vorgestellt: auf meiner HP liegt eine Datei mit dem Namen "ver.txt". Die wird heruntergeladen und der Inhalt mit der aktuellen Version verglichen. Allerdings habe ich mich noch nie mit Internetprogrammierung beschäftigt und wüsste deshalb gerne, wie man das realisieren kann.
Danke im Voraus,
AXMD

PS.: Ich habe @themoment kein Geld für einen eigenen Server, daher wäre mir die genannte Methode lieber als ein Programm, das an einem Serverport sitzt und Versionsnummernrequests bearbeitet.
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Sa 13.12.03 16:30 
Hi,

ich würde vorschlagen das du als "vers.txt" ne INI-Datei nimmst. Das Downloaden übernimmt die IdHTTP-Komponente aus den Indys udn schon is fertig :)
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 14.12.03 10:26 
oder du mimmst die download routine des IE. das hat den vorteil, dass wenn der user über einen proxy server im internet ist, der ja meinstens im IE eingetragen ist und du dann dadrüber downloaden kannst.
blöd ist das halt nur wenn der user über mozilla opera odre so im netz ist. dann kannst du nämlich nicht die proxy einstekllungen beeinflussen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 14.12.03 15:23 
@BungeeBug: klingt gut, danke für den Tip. Was mich interessieren würde: geht das Ganze auch ohne Komponente (WinAPI, FTP, o.ä.)?

AXMD
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: So 14.12.03 16:09 
Guck mal nach URLDownloadToFile. :)

_________________
Viele Grüße
Jakob
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 21.12.03 12:13 
Meinst du die hier?:

ausblenden Delphi-Quelltext
1:
function URLDownloadToFile(Caller: IUnknown; URL: PChar; FileName: PChar; Reserved: DWORD; StatusCB: IBindStatusCallback): HResult; stdcall;					


Wenn ja: kleine Frage hierzu: was übergeb ich als Caller bzw. StatusCB? Hab mich nämlich noch nie mit Interfaces beschäftigt :oops:

AXMD[/delphi]
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 21.12.03 12:27 
also folgenden code habe ich dir mal aus dem EDH 2000 rausgezogen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var Datei,Ziel:PChar;
begin
 try
  Label1.Caption := 'Download gestartet';
  Datei := 'http://www.DieSeite/DieDatei.zip';
  Ziel := 'C:\Windows\Desktop\DieDatei.zip';
  UrlDownloadToFile(nil, Datei, Ziel, 0, nil);
  Label1.Caption := 'Download beendet';
 except
  showmessage('Download abgebrochen');
 end;
end;

_________________
In the beginning was the word.
And the word was content-type: text/plain.
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 21.12.03 12:52 
Hi,

super, danke. Leider verschwinden die Zeilenumbrüche der heruntergeladenen Textdatei. Ist das immer so oder mach ich da was falsch?

AXMD
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 22.12.03 16:31 
komisch. das dürfete eigendlic nciht passieren. liegt das evtl am server ??

ansonsten mach das donloaden mal per indy. dazu einfach mal hier im forum suchen

_________________
In the beginning was the word.
And the word was content-type: text/plain.
BungeeBug
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 901



BeitragVerfasst: Mo 22.12.03 17:46 
Hi,

dann ist doch das einfachste das du z.B.: am Ende jeder Zeile nen . machst und beim lesen dann wieder guckst wo der . ist und da nen #13#10 ein haust. Musst dann beim verarbeiten nur den . weglassenn und fertig is.

Ansonsten kann ich mich nur Matze an schließen ... das kann nich sein!
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 24.12.03 09:51 
Hi,

vielen Dank für eure Hilfe. Das "Auf Update prüfen"-Feature ist jetzt in de rneuesten Programmversion verfügbar: [url]www.dustsigns.de.vu/downld15.html[/url].

Vielen Dank und frohe Weihnachten,
MfG AXMD