I copied it from the Microsoft site and changed it a bit.
At all events, it works as I needed.
Code:
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
bytesIn_Session = adapter.GetIPStatistics().BytesReceived;
bytesOutSession = adapter.GetIPStatistics().BytesSent;
if((bytesIn_Session>0) || (bytesOutSession > 0)) {
mbOutSession = bytesOutSession / _1MB;
mbIn_Session = bytesIn_Session / _1MB;
IPInterfaceProperties properties = adapter.GetIPProperties();
listBox2.Items.Add(adapter.Description);
listBox2.Items.Add(" Dynamically configured DNS ..... " + properties.IsDynamicDnsEnabled);
listBox2.Items.Add(" Received..... " + mbIn_Session);
listBox2.Items.Add(" Sent......... " + mbOutSession);
}//if
}//foreach