Results 1 to 5 of 5

Thread: [RESOLVED] im trying to make a download limiter

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Resolved [RESOLVED] im trying to make a download limiter

    hi
    is this right to figureout megabytes?


    Code:
    Dim c As New CIpHelper, R As Double, S As Double
    
        c.InitInterfaces
    
        If FirstTime Then
            FirstTime = False
            enviados = Format(c.BytesSent / 1024, ".0")
            recibidos = Format(c.BytesReceived / 1024, ".0")
        Else 'FIRSTTIME = FALSE/0
            R = ((c.BytesReceived / 1024) - recibidos) * 8
            S = ((c.BytesSent / 1024) - enviados) * 8
        End If
        
        Label1.Caption = "U:" & Format(S, ".0")
        Label2.Caption = "D:" & Format(R, ".0")

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: im trying to make a download limiter

    A KiloByte is 1024 Bytes
    A megabyte is 1024*1024 bytes

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: im trying to make a download limiter

    why is it timed by 8

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: im trying to make a download limiter

    Why is what multiplied by 8? You wrote the code don't you know?

    Hint: there are 8 bits in a byte

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: im trying to make a download limiter

    ok its binary
    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width