Sign in to follow this  
Followers 0
zxzxzx

Download more file at time ?

5 posts in this topic

hi,

I want to download more files at time .

How to use Inetget command ? Or How to do ?

Help me, please

Thank

Share this post


Link to post
Share on other sites



InetGet ( "URL" [,"filename" [, reload [, background]]] )

InetGet ( "URL" ,"filename" , 0 or 1, here put 1 )

I tested, but can't download theme at time

Share this post


Link to post
Share on other sites

Try this

And before anyone starts! once compiled this will still run on a computer without Autoit installed

If $CmdLine[0] > 0 then 
    Local $GetUrl, $LocalFile, $DontUseCached = 1
    
    For $i = 1 to $CmdLine[0]
        
        If StringLeft($CmdLine[$i],4) = "Get:" then $GetUrl = StringTrimLeft($CmdLine[$i],4)
        
        If StringLeft($CmdLine[$i],5) = "Save:" then $LocalFile  = StringTrimLeft($CmdLine[$i],5)
        
        If $CmdLine[$i] = "Reload:0" then $DontUseCached = 0
        
    Next
    If $GetUrl = "" then Exit
    If $LocalFile = "" then Exit
    _InetGet($GetUrl,$LocalFile,$DontUseCached)
    Exit
EndIf

_Download("http://www.bbc.co.uk/home/images/main_promo/games/doctor_who_blast_game3.jpg",@scriptDir & "\doctor_who_blast_game3.jpg")
_Download("http://www.2inept.co.uk/createdby.gif","createdby.gif")
_Download("http://www.2inept.co.uk/softpedia_clean_award_f.gif","softpedia_clean_award_f.gif")



Func _Download($Param1URL,$Param2LocalFile,$Param3NoCache = 1)
    
    If @compiled then 
        Run (FileGetShortName(@AutoItExe) &  ' "Get:' & $Param1URL & '" "Save:' & $Param2LocalFile & '"' & ' "Reload:' & $Param3NoCache & '"')
    Else
        Run (FileGetShortName(@AutoItExe) & ' /Autoit3ExecuteScript "' & @scriptName &  '" "Get:' & $Param1URL & '" "Save:' & $Param2LocalFile & '"' & ' "Reload:' & $Param3NoCache & '"')
    EndIf
    
EndFunc

Func _InetGet($URL,$FILENAME,$RELOAD)
    
    Local $iNetGet

    $iNetGet = InetGet($URL,$FILENAME,$RELOAD)
    If $iNetGet then 
        Msgbox(0 + 64 + 262144,"Download", $FILENAME & " has been downloaded successfully")
    Else
        Msgbox(0 + 64 + 262144,"Download", "Failed to download file from" & @crlf & $URL)
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Try this

And before anyone starts! once compiled this will still run on a computer without Autoit installed

If $CmdLine[0] > 0 then 
    Local $GetUrl, $LocalFile, $DontUseCached = 1
    
    For $i = 1 to $CmdLine[0]
        
        If StringLeft($CmdLine[$i],4) = "Get:" then $GetUrl = StringTrimLeft($CmdLine[$i],4)
        
        If StringLeft($CmdLine[$i],5) = "Save:" then $LocalFile  = StringTrimLeft($CmdLine[$i],5)
        
        If $CmdLine[$i] = "Reload:0" then $DontUseCached = 0
        
    Next
    If $GetUrl = "" then Exit
    If $LocalFile = "" then Exit
    _InetGet($GetUrl,$LocalFile,$DontUseCached)
    Exit
EndIf

_Download("http://www.bbc.co.uk/home/images/main_promo/games/doctor_who_blast_game3.jpg",@scriptDir & "\doctor_who_blast_game3.jpg")
_Download("http://www.2inept.co.uk/createdby.gif","createdby.gif")
_Download("http://www.2inept.co.uk/softpedia_clean_award_f.gif","softpedia_clean_award_f.gif")



Func _Download($Param1URL,$Param2LocalFile,$Param3NoCache = 1)
    
    If @compiled then 
        Run (FileGetShortName(@AutoItExe) &  ' "Get:' & $Param1URL & '" "Save:' & $Param2LocalFile & '"' & ' "Reload:' & $Param3NoCache & '"')
    Else
        Run (FileGetShortName(@AutoItExe) & ' /Autoit3ExecuteScript "' & @scriptName &  '" "Get:' & $Param1URL & '" "Save:' & $Param2LocalFile & '"' & ' "Reload:' & $Param3NoCache & '"')
    EndIf
    
EndFunc

Func _InetGet($URL,$FILENAME,$RELOAD)
    
    Local $iNetGet

    $iNetGet = InetGet($URL,$FILENAME,$RELOAD)
    If $iNetGet then 
        Msgbox(0 + 64 + 262144,"Download", $FILENAME & " has been downloaded successfully")
    Else
        Msgbox(0 + 64 + 262144,"Download", "Failed to download file from" & @crlf & $URL)
    EndIf
EndFunc
Thank you,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0