Author : Dr Morphin
Date Submitted : 10/3/2007
Category : Internet
Compatibility : .NET
This code has been accessed 3250 times.
Task : CP/IP data tranfer . that Shown Byte to you how send & receive Via Graph
Declarations
Code
' CP/IP data tranfer
' Packet [ Sent & Receive ] By Your Connection
' Shown To You How Do Work
'=========================================
' Coded By : Dr Morphin
' Date Create 10/4/2007
' Email Support PP : Dr_m0rphin@yahoo.com
'=========================================
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