Download a file.

Download a file.

URLDownloadToFile

See version :

Pas de dépendances

Download :

#include <windows.h>
#include <tchar.h>
#include <stdio.h>

#pragma comment(lib,"urlmon.lib")  // ou lier la lib urlmon.lib (ou .a) manuellement
#define URL _T("http://fvirtman.free.fr/index.html") // Url du fichier distant a recuperer
#define LOC _T("c:\\plouf.html") // Nom du fichier local qui sera cree

int main(void)
{
    printf("\nTelechargement de: %s ...", URL);
    if(URLDownloadToFile(0, URL, LOC, 0, 0))
    {
        printf("\nEchec URLDownloadToFile() !\n");
        return 1;
    }
    _tprintf(_T("\nLe fichier a ete copie ici: %s\n"), LOC);
    return 0;
}



Explanations

	No explanations yet.