Fergus Cooney said:
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