Einzelnen Beitrag anzeigen

_master_

Registriert seit: 13. Mär 2004
22 Beiträge
 
Delphi 6 Enterprise
 
#6

Re: Über FTP Daten hochladen

  Alt 23. Mär 2005, 21:52
Delphi-Quellcode:
uses WinInet;

function PutFile(Server, Port, UserName, Password, LocalFile, RemoteFile: String): Boolean;
var
  InternetOpn: hInternet;
  InternetCon: hInternet;
begin
  InternetOpn := InternetOpen('iexplore', INTERNET_OPEN_TYPE_DIRECT, nil, nil, 0);
  InternetCon := InternetConnect(InternetOpn,
                                 PChar(Server), // FTP Server
                                 StrToInt(Port), // FTP Port
                                 PChar(Username), // FTP UserName
                                 PChar(Password), // FTP Password
                                 INTERNET_SERVICE_FTP, // dwService
                                 INTERNET_FLAG_PASSIVE, // dwFlags
                                 0); // dwContext

  Result := FtpPutFile(InternetCon,
             pChar(LocalFile), // LocalFile
             pChar(RemoteFile), // RemoteFile
             FTP_TRANSFER_TYPE_UNKNOWN, // dwFlags
             0); // dwContext

  InternetCloseHandle(InternetOpn);
end;
  Mit Zitat antworten Zitat