Delphi-PRAXiS
Seite 4 von 4   « Erste     234   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Via FTP Datei hochladen (https://www.delphipraxis.net/132021-via-ftp-datei-hochladen.html)

xXxKoGaxXx 5. Apr 2009 12:44

Re: Via FTP Datei hochladen
 
Zitat:

Zitat von dutyfree
Wieso so kompliziert?

Delphi-Quellcode:
function putfile(server, username, password, localfile, remotefile: string; port: word = 21): boolean;
var
  hopen, hconnect: HINTERNET;
begin
  hopen := InternetOpen('myagent', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);
  hconnect := InternetConnect(hopen, pchar(server), port, pchar(username), pchar(password), INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
  Result := FtpPutFile(hconnect, pchar(localfile), pchar(remotefile), FTP_TRANSFER_TYPE_UNKNOWN, 0);
  InternetCloseHandle(hconnect);
end;
Aufruf:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
putfile(ftpadresse, loginname, loginpw, 'C:\deinedatei.txt', 'deinedatei.txt')
end;

Danke, hab es hinbekommen!

:)

:coder:

CuCu


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:43 Uhr.
Seite 4 von 4   « Erste     234   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz