Export (0) Print
Expand All
Expand Minimize

OperationalStatus Enumeration

Specifies the operational state of a network interface.

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

public enum OperationalStatus

Member nameDescription
DormantThe network interface is not in a condition to transmit data packets; it is waiting for an external event.
DownThe network interface is unable to transmit data packets.
LowerLayerDownThe 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.
NotPresentThe network interface is unable to transmit data packets because of a missing component, typically a hardware component.
TestingThe network interface is running tests.
UnknownThe network interface status is not known.
UpThe network interface is up; it can transmit data packets.

This enumeration defines valid values for the OperationalStatus property.

The following code example displays a summary for all interfaces on the local computer.

public static void ShowInterfaceSummary()
{

    NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
    foreach (NetworkInterface adapter in interfaces)
    {                
        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 += " ";
             }
            versions += "IPv6";
        }
        Console.WriteLine("  IP version .............................. : {0}", versions);
        Console.WriteLine();
    }
    Console.WriteLine();
}

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft