I just found System.Net.NetworkInformation
namespace and wrote following code:
NetworkInterface[] networkInterfaces =
NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in networkInterfaces)
{
IPv4InterfaceStatistics stats = ni.GetIPv4Statistics();
IPInterfaceProperties props = ni.GetIPProperties();
Console.WriteLine("{0} ({1:#,##0.00}Mb/s, {2})",
ni.Name, ni.Speed / 1024D / 1024D, ni.OperationalStatus);
Console.WriteLine("\t{0}", ni.Description);
Console.WriteLine("\t{0:#,##0.00}Mb sent, {1:#,##0.00}Mb received",
stats.BytesSent / 1024D / 1024D, stats.BytesReceived / 1024D / 1024D);
Console.WriteLine();
}
I got this output:
Local Area Connection 2 (953,67Mb/s, Up)
Realtek RTL8169/8110 Family PCI Gigabit Ethernet NIC (NDIS 6.0)
1.906,92Mb sent, 483,77Mb received
Local Area Connection 3 (9,54Mb/s, Down)
D-Link DFE-520TX PCI Fast Ethernet Adapter
0,00Mb sent, 0,00Mb received
Loopback Pseudo-Interface 1 (1.024,00Mb/s, Up)
Software Loopback Interface 1
0,00Mb sent, 0,00Mb received
HTH