endlesslove_1998

InetGet with Progress

Dec 19th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.60 KB | None | 0 0
  1. #include <InetConstants.au3>
  2. #include <MsgBoxConstants.au3>
  3.  
  4. Local $hDownload = InetGet("http://autoit.mvps.org/files/PcreTkit.zip", "PcreTkit.zip", $INET_BINARYTRANSFER, $INET_DOWNLOADBACKGROUND)
  5.  
  6. ProgressOn("Endless Love", "Downloading", "0%")
  7. Do
  8.     Local $iPercent = Int(InetGetInfo($hDownload, $INET_DOWNLOADREAD) / InetGetInfo($hDownload, $INET_DOWNLOADSIZE) * 100)
  9.     If $iPercent > 0 Then ProgressSet($iPercent, "Downloaded " & $iPercent & "%")
  10.     Sleep(100)
  11. Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
  12. ProgressOff()
  13.  
  14. InetClose($hDownload)
  15.  
  16. MsgBox($MB_SYSTEMMODAL, "", "Download complete!")
Advertisement
Add Comment
Please, Sign In to add comment