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::Name Property
.NET Framework (current version)
Gets the name of the network adapter.
Assembly: System (in System.dll)
The following code example displays a summary for all interfaces on the local computer.
void ShowInterfaceSummary() { array<NetworkInterface^>^interfaces = NetworkInterface::GetAllNetworkInterfaces(); System::Collections::IEnumerator^ myEnum5 = interfaces->GetEnumerator(); while ( myEnum5->MoveNext() ) { NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum5->Current); Console::WriteLine( "Name: {0}", adapter->Name ); Console::WriteLine( adapter->Description ); Console::WriteLine( String::Empty->PadLeft( adapter->Description->Length, '=' ) ); Console::WriteLine( " Interface type .......................... : {0}", adapter->NetworkInterfaceType ); Console::WriteLine( " Operational status ...................... : {0}", adapter->OperationalStatus ); String^ versions = ""; // Create a display string for the supported IP versions. if ( adapter->Supports( NetworkInterfaceComponent::IPv4 ) ) { versions = "IPv4"; } if ( adapter->Supports( NetworkInterfaceComponent::IPv6 ) ) { if ( versions->Length > 0 ) { versions = String::Concat( versions, " " ); } versions = String::Concat( versions, "IPv6" ); } Console::WriteLine( " IP version .............................. : {0}", versions ); Console::WriteLine(); } Console::WriteLine(); }
.NET Framework
Available since 2.0
Available since 2.0
Show: