![]() |
AW: Download mit https in Delphi 5
Zitat:
...:cat:... |
AW: Download mit https in Delphi 5
TDownloadURL nutzt intern übrigens auch URLDownloadToFileA/URLDownloadToFileW ;-)
...:cat:... |
AW: Download mit https in Delphi 5
Du könntest auch die Synapse Komponente ausprobieren, laut deren
![]() ![]() ![]() Weiters mus man folgende 2 Units im Quellcode einbinden:
Delphi-Quellcode:
jus
implementation
{$R *.dfm} uses ssl_openssl, ssl_openssl_lib; |
AW: Download mit https in Delphi 5
Oder eine DLL mit was Neuerem kompilieren und dann deine eigene Downloadfunktion importieren. :stupid:
|
AW: Download mit https in Delphi 5
Zitat:
Was ich mittlerweile Codierungszeit mit aktellen Delphi-Versionen spare ... Das es "nicht gerade bergauf" ging kann man wohl nur behaupten wenn man keine aktuellen Delphi-Versionen nutzt. |
AW: Download mit https in Delphi 5
Zitat:
![]() |
AW: Download mit https in Delphi 5
Hallo,
mit den Indy-Komponenten sollte das problemlos funktionieren:
Code:
unit HTTPS;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.DFM} uses IdHTTP,IdSSLOPENSSL,IdGlobal; var Http: TidHTTP; HTTPError:string; SSLHandler:TIdSSLIOHandlerSocketOpenSSL; procedure HTTPInit(UseSSL:Boolean;Timeout:Integer=2000); begin HTTPError:=''; if Http=nil then Http := TidHTTP.Create(Nil); if UseSSL then begin if SSLHandler=nil then begin SSLHandler:=TIdSSLIOHandlerSocketOpenSSL.Create; SSLHandler.MaxLineAction := maException; SSLHandler.SSLOptions.SSLVersions:=[sslvSSLv2, sslvSSLv23, sslvSSLv3, sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2]; SSLHandler.SSLOptions.Mode := sslmUnassigned; SSLHandler.SSLOptions.VerifyMode := []; SSLHandler.SSLOptions.VerifyDepth := 0; end; Http.IOHandler:= SSLHandler; end else begin Http.IOHandler:= NIL; end; Http.ReadTimeout:=Timeout; end; procedure HTTPClose; begin if Http<>nil then begin Http.Free; HTTP:=nil; end; if SSLHandler<>nil then begin SSLHandler.Free; SSLHandler:=nil; end; end; function LoadURL(const url:string; Timeout:Integer=2000):string; var UseSSL:Boolean; begin HTTPError:=''; if Http=nil then Http := TidHTTP.Create(Nil); UseSSL:=Uppercase(Copy(url,1,5))='HTTPS'; HTTPInit(UseSSL, Timeout); Try result := Http.Get(url); except on e:Exception do begin Result:=''; HTTPError:=e.Message; end; end; HTTPClose; end; procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Text := LoadURL('https://www.delphipraxis.net'); end; end. |
AW: Download mit https in Delphi 5
Zitat:
|
AW: Download mit https in Delphi 5
Zitat:
|
AW: Download mit https in Delphi 5
@jik: Irgendwann stellt sich doch die Frage nach Aufwand und Nutzen. TLS 1.2 und D5 wird Arbeit machen, Umstieg auf ein aktuelles Delphi ebenso. Ich habe auch lange gewartet und bin erst von D7 auf XE4 umgestiegen weil ich genauso dachte wie du. Ganz ehrlich, aus heutiger Sicht ein großer Fehler. Du schreibst nichts darüber ob du privat oder kommerziell programmierst. Aber zumindest für Evaluierungszwecke solltest du dir die aktuelle Community-Edition mal anschauen.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:05 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