调用 wininet.pas 中的各个函数即可。
如:
HINTERNET InternetConnect(
IN HINTERNET hInternet,
IN LPCTSTR lpszServerName,
IN INTERNET_PORT nServerPort,
IN LPCTSTR lpszUserName,
IN LPCTSTR lpszPassword,
IN DWORD dwService,
IN DWORD dwFlags,
IN DWORD_PTR dwContext
);
HINTERNET InternetOpen(
IN LPCTSTR lpszAgent,
IN DWORD dwAccessType,
IN LPCTSTR lpszProxyName,
IN LPCTSTR lpszProxyBypass,
IN DWORD dwFlags
);
BOOL FtpSetCurrentDirectory(
IN HINTERNET hConnect,
IN LPCTSTR lpszDirectory
);
BOOL FtpGetFile(
IN HINTERNET hConnect,
IN LPCTSTR lpszRemoteFile,
IN LPCTSTR lpszNewFile,
IN BOOL fFailIfExists,
IN DWORD dwFlagsAndAttributes,
IN DWORD dwFlags,
IN DWORD_PTR dwContext
);