|
-
Sep 19th, 2001, 02:53 AM
#5
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|