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 Form_Load()
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
Debug.Print stat.dwAlignmentErr
Debug.Print stat.dwBps
Debug.Print stat.dwBufferOverrunErr
Debug.Print stat.dwBytesRcved
Debug.Print stat.dwBytesXmited
Debug.Print stat.dwCompressionRatioIn
Debug.Print stat.dwCompressionRatioOut
Debug.Print stat.dwConnectDuration
Debug.Print stat.dwCrcErr
Debug.Print stat.dwFramesRcved
Debug.Print stat.dwFramesXmited
Debug.Print stat.dwFramingErr
Debug.Print stat.dwTimeoutErr
End If
End If
End Sub
uhm писал(а):Интересно, это рекорд некрофилии?
Сейчас этот форум просматривают: Google-бот, Yandex-бот и гости: 26