This documentation is archived and is not being maintained.
OperationalStatus Enumeration
Visual Studio 2010
Specifies the operational state of a network interface.
Assembly: System (in System.dll)
| Member name | Description | |
|---|---|---|
| Up | The network interface is up; it can transmit data packets. | |
| Down | The network interface is unable to transmit data packets. | |
| Testing | The network interface is running tests. | |
| Unknown | The network interface status is not known. | |
| Dormant | The network interface is not in a condition to transmit data packets; it is waiting for an external event. | |
| NotPresent | The network interface is unable to transmit data packets because of a missing component, typically a hardware component. | |
| LowerLayerDown | The network interface is unable to transmit data packets because it runs on top of one or more other interfaces, and at least one of these "lower layer" interfaces is down. |
This enumeration defines valid values for the OperationalStatus property.
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(); }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: