function PutFile1(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,
convert.tostring(Server),
// FTP Server
convert.ToInt32(Port),
// FTP Port
convert.tostring(Username),
// FTP UserName
convert.tostring(Password),
// FTP Password
INTERNET_SERVICE_FTP,
// dwService
INTERNET_FLAG_PASSIVE,
// dwFlags
0);
// dwContext
Result := FtpgetFile(InternetCon,
// LocalFile
convert.tostring(RemoteFile), convert.tostring(LocalFile),
true,(0),
// RemoteFile
FTP_TRANSFER_TYPE_UNKNOWN,
// dwFlags
0);
InternetCloseHandle(InternetOpn);
end;