By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,702 Members | 1,485 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,702 IT Pros & Developers. It's quick & easy.

Incoming Outgoing Bandwidth Traffic

P: n/a
Hey guys and gals, I was wondering how I could do a bandwidth traffice moniter on incoming and outgoing traffic on a network card. is there a simple way to moniter and record the traffic? I know of performance counter but did not get it working. Thanks for the help in advance. -Smartbomb
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

"Smartbomb" <mo*******@hotmail.com> wrote in message
news:D_***************@nwrddc03.gnilink.net...
Hey guys and gals, I was wondering how I could do a bandwidth traffice

moniter >on incoming and outgoing traffic on a network card. is there a
simple way to >moniter and record the traffic? I know of performance counter
but did not get it >working. Thanks for the help in advance. -Smartbomb

Sounds like you have the answer to your own question: use the perfomance
counters.

Now what problem were you having?

David
Nov 20 '05 #2

P: n/a
Well I would put it into the program, fill out the information in the
properties section and well from there I wasn't sure how to have it
measure the network card's activity. I tired many ways but i just could
not get the counter to count heh. Any help with the counter would be
apperciated. Thanks for the quick reply and thanks again in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

P: n/a
Howdy SmartBomb,

What performance counter are you using? Do you know where there is a list
of the available categories and counters?

Regards,
Fergus
Nov 20 '05 #4

P: n/a


hi Fergus, i'm using the performance counter that is found under
Toolbox->Components->Performance Counter. And sorry I do not know a
list. -Smartbomb
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

P: n/a

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:ON**************@tk2msftngp13.phx.gbl...
Howdy SmartBomb,

What performance counter are you using? Do you know where there is a list of the available categories and counters?

Regards,
Fergus


Run Perfmon.exe to see all the available counters.

And here's a sample for network monitoring.
It uses the network interface, you might want to monitor a different one or
all of them.
David

Imports System.Diagnostics
Module Module1

Sub Main()

Dim pc As New PerformanceCounterCategory("Network Interface")
Dim instance As String = pc.GetInstanceNames(0)
Dim bs As New PerformanceCounter("Network Interface", "Bytes Sent/sec",
instance)
Dim br As New PerformanceCounter("Network Interface", "Bytes
Received/sec", instance)

Console.WriteLine("Monitoring " & instance)
Do
Dim kbSent As Integer = bs.NextValue() / 1024
Dim kbReceived As Integer = br.NextValue() / 1024
Console.WriteLine(String.Format("Bytes Sent {0}k Bytes Received {1}k",
kbSent, kbReceived))
Threading.Thread.Sleep(1000)
Loop

End Sub

End Module
Nov 20 '05 #6

P: n/a
Hi SmartBomb,

I didn't mean which Control, I meant which category and counter. :-)

However I found out for myself where the list is. I think it may depend on
what version of VS you have, but in the Server Explorer (View menu) there is
the complete list. Woohoo! It may be that you are choosing the wrong counter
or that a combination would serve your needs.
Nov 20 '05 #7

P: n/a
Thanks David and Fergus! The code helped a lot. and the counter list
(which i did not know exsited) helped quite a bit as well. I was able to
piece them together with some edits and finally get it working! Thanks
guys!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.