Sign in to follow this  
Followers 0
IKilledBambi

inetget etc.

4 posts in this topic

Is there a better way to get how much is left than this?

While @InetGetActive
    $size = InetGetSize($url)
    $read = @InetGetBytesRead
    $iPercentage = Round(($size/$read)*100,0)
  TrayTip("Downloading", $iPercentage, 10, 16)
  Sleep(250)
Wend

I found that on the forums but I'm definately not liking how it works. If at all possible I would like to convert to megabytes.

1 megabyte = 1 048 576 bytes

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Would you be looking for something like this?

While @InetGetActive
    $fSize = Round((InetGetSize($url)/1048576),2)
    $fRead = Round((@InetGetBytesRead/1048576),2)
  TrayTip("Downloading", $fRead&" of "&$fSize&"MB", 10, 16)
  Sleep(250)
Wend
Edited by this

UDFsWinSineInOutResize () - Resize a window smoothly based on a sine curve.

Share this post


Link to post
Share on other sites

$fSize = Round(InetGetSize($url)/1048576,2)
While @InetGetActive
    $fRead = Round((@InetGetBytesRead/1048576),2)
  TrayTip("Downloading", $fRead&" of "&$fSize&"MB", 10, 16)
  Sleep(250)
Wend

Polling the server every loop is a waste of bandwidth.

Share this post


Link to post
Share on other sites

I love you! :) Thanks a bundle!

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