Page 3 of 3

Re: Function to download a defined file from a homepage ?

PostPosted: Thu May 12, 2016 7:23 pm
by Baxajaun

Re: Function to download a defined file from a homepage ?

PostPosted: Sat Aug 13, 2016 8:10 am
by jesusdelamora
Antonio Linares wrote:
Code: Select all  Expand view
#include "fivewin.ch"

    function Main()
            LOCAL   nRet
           
            nRet := DOWNLOADFILE( "http://www.yoursite.it/index.html", "C:\index.html" )
           
            MsgStop( nRet )
    RETURN NIL


    #pragma BEGINDUMP

    #include <Windows.h>
    #include <hbapi.h>
    #include <urlmon.h>

    HB_FUNC( DOWNLOADFILE )

    {
            HRESULT hr;
           
            hr = URLDownloadToFile( NULL, hb_parc( 1 ), hb_parc( 2 ), 0, NULL ) ;
           
            hb_retnl( hr ) ;
    }

    #pragma ENDDUMP
 





GRACIAS POR LA INFORMACION