PlatformVB

DUN Statistics  for win2000

In windows 2000, you can use the RAS functions, RasGetConnectionStatistics and RAsGetLinkStatistics. The declarations for these and the RAS_STATS structure are listed below.

You would probably call them like so:

Dim myStats As RASSTATS2000
Dim rtn as Long
myStats.dwSize = LenB(myStats)
rtn = RasGetConnectionStatistics(hRasConn, myStats)

Note: in above code hRasConn is a long returned from a RasDial or RssEnumConnections operation.

Public Type RASSTATS2000
    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

Declare Function RasGetConnectionStatistics Lib "rasapi32.dll" _
            (ByVal hRasConn As Long, _
            lpStatistics As RASSTATS2000) As Long

Declare Function RasGetLinkStatistics Lib "rasapi32.dll" _
            (ByVal hRasConn As Long, _
            ByVal dwSubEntry As Long, _
            lpStatistics As RASSTATS2000) As Long

 

See Also: Contents, Introduction, RasStats Overview, RasStats95, RasStatsNT