Results 1 to 8 of 8

Thread: Bytes transmitted - Dial up connection

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    129

    Question Bytes transmitted - Dial up connection

    I want to retreive the amount of BYTES being trasmitted by a RAS connection. All I want to do is call a sub to say to me :


    56,000,434 bytes received
    1,000,000 bytes sent

    Is this going to be an API call ? I assumed so, but wasn't sure how to do it. If you know, please help me in any way that you can. the more detailed information, the better, because I am not very fluent at calling API's.

    Thanks all for your help.

    BaLLZaCH
    [email protected]
    www.ballzach.com
    VB6
    BaLLZaCH

  2. #2
    AutoBot
    Guest

    Thumbs up Here it is.

    I attached a project that you can look at.

  3. #3
    AutoBot
    Guest

    Ooops :)

    Ok I attached it this time.
    Attached Files Attached Files

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    129
    Sweet AutoBot, that is 150% exactly what I was looking for.

    Although, I did think of something else just now - do you know to to check and see if there is conncetion at all ? I mean like, display if any RAS is currently connected, or if your connction status is null, you know.

    Anyways, you helped me a lot. Hey Autobot ....

    I see you use XP RC2. I have written a little app and package (not much but contanis useful information and apps). Check it out. You can download it from:

    http://www.ballzach.com

    Just click "Windows Page" from the top left, and then select XP.EXE - Its a self extracting zip. I cant attach it, its a little over 1 meg... Let me know what you think - pass it around, its kewl.

    BaLLZaCH
    XP RC1, 2
    VB5, 6


    HTTP://WWW.BALLZACH.COM
    or HTTP://DIRECT.BALLZACH.COM (Click on xp.exe)
    BaLLZaCH

  5. #5
    AutoBot
    Guest

    Yep

    Here is what your looking for I believe:

    'Example created by ÅutoBot ([email protected])
    Private Declare Function RasEnumConnections Lib "rasapi32" Alias "RasEnumConnectionsA" (ByVal lprasconn As Long, ByVal lpcb As Long, ByVal lpcConnections As Long) As Long
    Private Declare Function RasGetConnectionStatistics Lib "rasapi32" (ByVal hRasConn As Long, ByVal lpStatistics As Long) As Long
    Private Type RASCONN
    dwSize As Long
    hRasConn As Long
    szEntryName(0 To 256) As Byte
    szDeviceType(0 To 16) As Byte
    szDeviceName(0 To 128) As Byte
    pad As Byte
    End Type
    Private Type RAS_STATS
    dwSize As Long
    dwBytesXmited As Long
    dwBytesRcved As Long
    dwFramesXmited As Long
    dwFramesRcved As Long
    dwCrcErr As Long
    dwTimeoutErr As Long
    dwAlignmentErr As Long
    dwHardwareOverrunErr As Long
    dwFramingErr As Long
    dwBufferOverrunErr As Long
    dwCompressionRatioIn As Long
    dwCompressionRatioOut As Long
    dwBps As Long
    dwConnectDuration As Long
    End Type

    Private Sub Command1_Click()

    Dim conn As RASCONN
    Dim stat As RAS_STATS
    Dim y As Long, z As Long

    conn.dwSize = Len(conn)
    y = conn.dwSize

    If RasEnumConnections(VarPtr(conn), VarPtr(y), VarPtr(z)) = 0 Then

    stat.dwSize = Len(stat)

    If RasGetConnectionStatistics(conn.hRasConn, VarPtr(stat)) = 0 Then

    MsgBox "Your Connected"

    Else

    MsgBox "Your Not Connected"

    End If

    End If

    End Sub

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    129
    Yeah, believe it or not, I actually saw that on another one of your posts - But I am glad you were nice enough to re-post it instead of yelling at me :-) Hehe, anyway, check out the XPHACKPAK man, let me know what you think. I know its lamo, but hey, it really does have some kewl stuff in it - I promise. Check it out.

    BaLLZaCH
    BaLLZaCH

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Posts
    129
    Thanks for all your help.


    Download BZAutosurf,
    http://bzas.ballzach.com

    YOURNAME
    kkk70001866bzas



    The information you gave me helped create the "SMART MODE" of this program. BZAS is an "auto surf" with a whole buncha options. The SMART MODE looks at internet connection, compares, and decides what to do (Stay IDLE, start surfing, halt because of no connection, etc...) Many option to set, cool app.

    Try it our man. (No I didnt expect anybody to actually register this app, I just wanted to see a c r a k for it on the internet :-) hehe )

    BaLLZaCH
    www.ballzach.com
    BaLLZaCH

  8. #8
    AutoBot
    Guest

    Sure Thing

    Ahh I don't mind helping at all, like someone told me the first time I posted something here. "Thats what we and this forum are here for."

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