How to download a file from the Web using Win API?

    2 answers 2

    Winet API is suitable for this:

    BYTE buffer[TOTAL]; DWORD total = 0, read = 0; while (InternetReadFile(from, buffer + total, TOTAL - total, &read) != FALSE) { // Проверить объем скачанных данных // Что-нибудь сделать с данными } 

    Read more: introduction to WinInet .

    • The question was about the Win API, not about the wrappers. - skegg pm
    • one
      In a broad sense, WinINet is included in the Windows API. Usually opposed to MFC or .NET and the "bare" API. - stanislav

    Sockets + ftp and http protocols

    • 2
      A question the answer. Laconic @Sawich Only I thought that the sessions were over. Or is it for the second semester? - alexlz