|
-
Feb 27th, 2011, 01:33 PM
#1
Thread Starter
Fanatic Member
-
Feb 27th, 2011, 02:21 PM
#2
Hyperactive Member
Re: Monitor Internet Traffic.
Something quick. Something like this? 5 textboxes and a timer set to 100 milliseconds
Code:
Imports System.Net.NetworkInformation
Public Class Form1
Dim Properties As IPGlobalProperties
Dim StatV4 As IPGlobalStatistics
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text = ("")
TextBox2.Text = ("")
TextBox3.Text = ("")
TextBox4.Text = ("")
TextBox5.Text = ("")
Properties = IPGlobalProperties.GetIPGlobalProperties
StatV4 = Properties.GetIPv4GlobalStatistics
TextBox1.Text = "Hostname: " & Properties.HostName & vbNewLine
TextBox2.Text &= "Received: " & StatV4.ReceivedPackets & vbNewLine
TextBox3.Text &= "Delivered: " & StatV4.ReceivedPacketsDelivered & vbNewLine
TextBox4.Text &= "Discarded: " & StatV4.ReceivedPacketsDiscarded & vbNewLine
TextBox5.Text &= "Forwarded: " & StatV4.ReceivedPacketsForwarded & vbNewLine
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
-
Feb 27th, 2011, 02:32 PM
#3
Thread Starter
Fanatic Member
Re: Monitor Internet Traffic.
Hmm That looks good Except that that Counts Packets. Since packets can vary of sizes , It would be better to Count bytes if possible, But packets should also give an indication of where the most traffic is.
-
Feb 27th, 2011, 03:13 PM
#4
Thread Starter
Fanatic Member
Re: Monitor Internet Traffic.
After quite a few google searches i Found that everything is Under NetworkInterfaces.
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
|