Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

NetworkInterface::Speed Property

 

Gets the speed of the network interface.

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

public:
property long long Speed {
	virtual long long 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.

void ShowInterfaceSpeedAndQueue()
{
   array<NetworkInterface^>^adapters = NetworkInterface::GetAllNetworkInterfaces();
   System::Collections::IEnumerator^ myEnum9 = adapters->GetEnumerator();
   while ( myEnum9->MoveNext() )
   {
      NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum9->Current);
      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:
© 2017 Microsoft