NetworkInterface.OperationalStatus : NetworkInterface « System.Net.NetworkInformation « C# / C Sharp by API






NetworkInterface.OperationalStatus

  

using System;
using System.Net.NetworkInformation;

class MainClass
{
    static void Main()
    {
        if (!NetworkInterface.GetIsNetworkAvailable())
           return;

        NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();

        foreach (NetworkInterface ni in interfaces)
        {
            
            Console.WriteLine("Interface Name: {0}", ni.Name);
            Console.WriteLine("    Description: {0}", ni.Description);
            Console.WriteLine("    ID: {0}", ni.Id);
            Console.WriteLine("    Type: {0}", ni.NetworkInterfaceType);
            Console.WriteLine("    Speed: {0}", ni.Speed);
            Console.WriteLine("    Status: {0}", ni.OperationalStatus);
        }
    }
}

   
    
  








Related examples in the same category

1.NetworkInterface.GetIPProperties()
2.NetworkInterface.GetIPv4Statistics()
3.NetworkInterface.GetIsNetworkAvailable
4.NetworkInterface.GetPhysicalAddress
5.NetworkInterface.NetworkInterfaceType
6.NetworkInterface.Speed