can you give a little example ?
What about the reset of the value around 5GB ?
"Milosz Skalecki" <
[email protected]> schreef in bericht
Yep,
You can use easier approach performanceCounter.NextSample().RawValue
--
Milosz Skalecki
MCP, MCAD
:
You are pointing to this?
VB.NET code:
Try
Dim searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT
BytesReceivedPersec,BytesSentPersec,BytesTotalPersec FROM
Win32_PerfRawData_Tcpip_NetworkInterface")
Dim totaalverzonden, totaalontvangen, totaal As Int64
For Each queryObj As ManagementObject In searcher.Get()
totaalontvangen = totaalontvangen +
Convert.ToInt64(queryObj("BytesReceivedPersec"))
totaalverzonden = totaalverzonden +
Convert.ToInt64(queryObj("BytesSentPersec"))
totaal += Convert.ToInt64(queryObj("BytesTotalPersec"))
Next
Console.WriteLine("Totaalontvangen: " & totaalontvangen.ToString)
Console.WriteLine("Totaalverzonden: " & totaalverzonden.ToString)
Console.WriteLine("Totaal: " & totaal.ToString)
Catch err As ManagementException
Console.WriteLine("An error occurred while querying for WMI data:
" &
err.Message)
End Try
I thought, yess I have finally found it . But the value resets(<-- I
tink
it
resets) around 5,5 GB.
"Milosz Skalecki" <
[email protected]> schreef in bericht
If you don't want per sec use RawValue. "Network connection status"
and
"Task
Manager" display raw value of the "Packets Received Unicast"
preformance
counter( well almost - i dont know why "Network connection status"
shows
different value for the total packet sent, but the same for
received)
Hope this helps
--
Milosz Skalecki
MCP, MCAD
:
But that counter is per second.
How do I know what is send sinds the reboot ?
Or where can I find the elapsed seconds ? So I can multiply it with
the
counter bytes/sec.
"Milosz Skalecki" <
[email protected]> schreef in bericht
Use PerformanceCounter class. Set CategoryName to "Network
Interface"
and
select "Bytes Received/sec" etc.
Hope this helps
--
Milosz Skalecki
MCP, MCAD
:
Hi all,
http://www.aswin.be/nictransfer.JPG
How can I get these numbers with VB.NET ?
I thought somewhere in WMI but I can't find them.
Thank you,
Aswin