NetworkInterface.Speed Property

 

Gets the speed of the network interface.

Namespace:   System.Net.NetworkInformation
Assembly:  System (in System.dll)

public virtual long Speed { get; }

Property Value

Type: System.Int64

A Int64 value that specifies the speed in bits per second.

The value returned by this property is reported by the network interface. It is not computed dynamically.

The following code example demonstrates displaying the speed of interfaces on the local computer.

public static void ShowInterfaceSpeedAndQueue()
{
    NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in adapters)
    {
        IPInterfaceProperties properties = adapter.GetIPProperties();
        IPv4InterfaceStatistics stats = adapter.GetIPv4Statistics();
         Console.WriteLine(adapter.Description);
        Console.WriteLine("     Speed .................................: {0}", 
            adapter.Speed);
        Console.WriteLine("     Output queue length....................: {0}", 
            stats.OutputQueueLength);
    }
}

.NET Framework
Available since 2.0
Return to top
Show: