uses
WinInet;
procedure TForm1.Button1Click(Sender: TObject);
var
hInternetOpen, hInternetConnect: HINTERNET;
begin
hInternetOpen := InternetOpen('
FTP', INTERNET_OPEN_TYPE_DIRECT, '
', '
', 0);
if Assigned(hInternetOpen)
then
try
hInternetConnect := InternetConnect(hInternetOpen, '
ftp.microsoft.com', INTERNET_DEFAULT_FTP_PORT, '
irgendwas', '
keineahnung', INTERNET_SERVICE_FTP, 0, 0);
if Assigned(hInternetConnect)
then
try
ShowMessage('
OK');
finally
InternetCloseHandle(hInternetConnect);
end
else
ShowMessage(SysErrorMessage(GetLastError));
finally
InternetCloseHandle(hInternetOpen);
end
else
ShowMessage(SysErrorMessage(GetLastError));
end;