I need a way to get the current system network usage, up and down.
I found some on the net but they\'re not working out for me.
Thanks for your help
Code
Please see Report information from NetworkInterface: network statistics for a good sample program:
using System;
using System.Net.NetworkInformation;
class MainClass
{
static void Main()
{
if (!NetworkInterface.GetIsNetworkAvailable())
return;
NetworkInterface[] interfaces
= NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in interfaces)
{
Console.WriteLine(" Bytes Sent: {0}",
ni.GetIPv4Statistics().BytesSent);
Console.WriteLine(" Bytes Received: {0}",
ni.GetIPv4Statistics().BytesReceived);
}
}
}