Ferme un handle retourn� par InetGet().
InetClose ( handle )
handle | Le handle retourn� par InetGet(). |
True: | Le handle a �t� trouv� et ferm�. |
False: | Sinon. |
#include <InetConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Example() Func Example() ; Enregistre le fichier t�l�charg� dans le dossier temporaire. Local $sFilePath = _WinAPI_GetTempFileName(@TempDir) ; T�l�charge le fichier en arri�re-plan avec l'option choisie de "forcer le chargement du site distant." Local $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) ; Attend la fin du t�l�chargement en v�rifiant si la valeur du 2nd index de InetGetInfo retourne True. Do Sleep(250) Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) ; R�cup�re le nombre total d'octets re�us et la taille du fichier. Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD) Local $iFileSize = FileGetSize($sFilePath) ; Ferme le handle retourn� par InetGet. InetClose($hDownload) ; Affiche les d�tails sur le nombre total d'octets lus et la taille du fichier. MsgBox($MB_SYSTEMMODAL, "", "Taille totale: " & $iBytesSize & @CRLF & _ "Taille totale du fichier: " & $iFileSize) ; Supprime le fichier. FileDelete($sFilePath) EndFunc ;==>Example