Я пару месяцев новичок в Lazarus. Я пытаюсь создать небольшую FTP-программу, которая отправит небольшой файл после входа в систему. У меня есть все вещи для gooey, и моя единственная проблема - часть FTP. Я получаю кучу ошибок, и я изо всех сил, чтобы установить правильные пакетыЕсть ли простой способ использовать функцию FTP в коде Lazarus
Мой FTP код выглядит следующим образом
function TModel.Send(LocalFile : string; remoteFile : string; RemoteDir : string) : boolean;
//===========================================================================
// **********************************************************************
// * Send a file to the FTP server *
// **********************************************************************
//---------------------------------------------------------------------------
var
rc : boolean;
begin
// Create the FTP Client object and set the FTP parameters
FTPClient := TFTPSend.Create;
with FTPClient do begin
TargetPort := cFtpProtocol;
TargetHost := fHost; // these were properties set somewhere else
UserName := fUserID;
Password := fPassword;
//-----------------------------------------------------------------------
// bail out if the FTP connect fails
if not LogIn then exit;
//------------------------------------------------------------------------
// Set filename to FTP
DirectFileName := LocalFile;
DirectFile := True;
//------------------------------------------------------------------------
// change directory if requested
if RemoteDir <> '' then ChangeWorkingDir(RemoteDir);
//------------------------------------------------------------------------
// STOR file to FTP server.
rc := StoreFile(RemoteFile,false);
//------------------------------------------------------------------------
// close the connection
LogOut;
//------------------------------------------------------------------------
// free the FTP client object
free;
//------------------------------------------------------------------------
end;
Result := rc;
//===========================================================================
end;
Спасибо за вашу помощь.
Спасибо за код –