Hier ein mini Beispiel ohne Wrapper:
Delphi-Quellcode:
function DownLoadInternetFile(Source, Dest : String): Integer;
begin
try
Result := URLDownloadToFile(nil, PChar(Source), PChar(Dest), 0, nil);
except
Result := -1;
end;
end;
Mögliche Return Codes:
S_OK
The download started successfully.
E_OUTOFMEMORY
The buffer length is invalid, or there is insufficient memory to complete the operation.
INET_E_DOWNLOAD_FAILURE
The specified resource or callback interface was invalid.
-1
Exception
Anleitung zur
API:
URLDownloadToFile