by Dr Morphin (8 Submissions)
Category: Internet/HTML
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Sat 10th March 2007
Date Added: Mon 8th February 2021
Rating: (1 Votes)
CP/IP data tranfer . that Shown Byte to you how send & receive Via Graph
API Declarations
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Declare Function SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function GetTcpStatistics Lib "iphlpapi.dll" (pStats As TCPSTATISTICS) As Long
Public Type TCPSTATISTICS
AlgorithmTimeout As Long
MinTimeout As Long
MaxTimeout As Long
MaxConnections As Long
ActiveOpenConnections As Long
PassiveOpenConnections As Long
FailedAttempts As Long
EstablishedConnectionResets As Long
CurrentEstablishedConnections As Long
SegmentsReceived As Long
SegmentsSent As Long
SegmentsRetransmitted As Long
IncomingErrors As Long
OutgoingResets As Long
CumulativeConnections As Long
End Type
Public Sub StayOnTop(Frm As Form)
setontop = SetWindowPos(Frm.hwnd, -1, 0, 0, 0, 0, FLAGS)
End Sub
' Packet [ Sent & Receive ] By Your Connection
' Shown To You How Do Work
'=========================================
' Coded By : Dr Morphin
' Date Create 10/4/2007
' Email Support PP : [email protected]
'=========================================
Option Explicit
Dim Arr1(130) As Integer
Dim Arr2(130) As Integer
Dim RecVal, SenVal As Integer
Dim FirstRecVal, FirstSenVal As Integer
Private Sub Form_Load()
Call StayOnTop(Form1)
Me.Left = Screen.Width - Me.Width - 50
Me.Top = 50
Er = GetTcpStatistics(TCPSTATISTICS)
If Er <> 0 Then
Exit Sub
End If
FirstRecVal = TCPSTATISTICS.SegmentsReceived
FirstSenVal = TCPSTATISTICS.SegmentsSent
End Sub
Private Sub Timer1_Timer()
Dim Dif1 As Integer
Dim Dif2 As Integer
Er = GetTcpStatistics(TCPSTATISTICS)
If Er <> 0 Then
Exit Sub
End If
P1.Cls
P2.Cls
P1.Print "Bytes received"
P2.Print "Bytes send"
RecVal = TCPSTATISTICS.SegmentsReceived
SenVal = TCPSTATISTICS.SegmentsSent
Dif1 = RecVal - FirstRecVal
Dif2 = SenVal - FirstSenVal
Dif1 = Dif1 * 70 'Make this value lower if you have a
'faster connection or higher if you
Dif2 = Dif2 * 70 'have a slower connection.
ResortArray Dif1, Dif2
For z = 0 To 130
P1.Line (P1.Width - (z * 30), P1.Height - Arr1(z))-(P1.Width - (z * 30), P1.Height)
P2.Line (P2.Width - (z * 30), P2.Height - Arr2(z))-(P2.Width - (z * 30), P2.Height)
Next z
FirstRecVal = RecVal
FirstSenVal = SenVal
End Sub
Private Sub ResortArray(NewVal As Integer, NewVal2 As Integer)
For z = 129 To 0 Step -1
Arr1(z + 1) = Arr1(z)
Arr2(z + 1) = Arr2(z)
Next z
Arr1(0) = NewVal
Arr2(0) = NewVal2
End Sub
No comments have been posted about CP/IP data tranfer . that Shown Byte to you how send & receive Via Graph. Why not be the first to post a comment about CP/IP data tranfer . that Shown Byte to you how send & receive Via Graph.