ora si può scegliere la directory di destinazione... e per renderlo più figo ho aggiunto una skin XD
metto in allegato il download..
CODICE
#cs ----------------------------------------------------------------------------
Author: xEdox
Script Function:
Download a file from the web.
License:
Script released under GPL v3
#ce ----------------------------------------------------------------------------
#include <GUIConstants.au3>
#include "skin.au3"
SkinStartLibrary ()
$form = GUICreate (" ~ Downloader ~ " , 295 , 150)
AddSkin ($form , @ScriptDir & "\skin.skf")
GUICtrlCreateLabel ("Inserisci l'url: " , 5 , 10 , 100 , 20)
$url = GUICtrlCreateInput ("" , 5 , 30 , 200 , 20)
$download = GUICtrlCreateButton ("Download" , 220 , 27 , 70 , 25)
GUICtrlCreateLabel ("Percorso destinazione: " , 5 , 70 , 120 , 20)
$dest = GUICtrlCreateInput ("" , 5 , 90 , 150 , 20)
$sfoglia = GUICtrlCreateButton ("Sfoglia.." , 165 , 87 , 60 , 25)
$open = GUICtrlCreateButton ("Apri.." , 230 , 87 , 60 , 25)
GUICtrlCreateLabel ("Versione 3.0" , 5 , 130 , 200 , 20)
GUISetState ()
While 1
Switch GUIGetMsg ()
Case $GUI_EVENT_CLOSE
Exit
Case $download
$link = GUICtrlRead ($url)
$de = GUICtrlRead ($dest)
If $link = "" Then
MsgBox (0 , " ~ Downloader ~ " , "Specifica un link per il download")
Else
If $de = "" Then
$de = @DesktopDir
EndIf
$nome = StringSplit ($link , "/")
$count_nome = UBound ($nome)
$download_real = InetGet ($link , $de & "\" & $nome [$count_nome - 1])
If $download_real = 1 Then
MsgBox (0 , " ~ Downloader ~ " , "Download eseguito correttamente")
Else
MsgBox (0 , " ~ Downloader ~ " , "Il download non è stato eseguito a causa di un problema")
EndIf
EndIf
Case $sfoglia
$folder = FileSelectFolder ("Seleziona la directory di uscita" , @DesktopDir)
GUICtrlSetData ($dest , $folder)
Case $open
If GUICtrlRead ($dest) = "" Then
MsgBox (0 , " ~ Downloader ~ " , "Devi prima specificare un percorso!")
Else
ShellExecute (GUICtrlRead ($dest))
EndIf
EndSwitch
WEnd