title: how to get list of wired LAN connections ignoring Wifi (wireless) LAN connection in C#
body: <p>in C#, I want to get list of wired LAN connection of my laptop at runtime, but I do not want any wifi or wireless LAN.</p>
  
  <p>I have used various ways to get network list :-</p>
  
  <p><code>ManagementClass</code>:</p>
  
  <pre><code>ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
   ManagementObjectCollection objMOC = objMC.GetInstances();
  
   foreach (ManagementObject objMO in objMOC)
          {
              if (!(bool)objMO["ipEnabled"])
                  continue;
             this.textBox1.Text += (Convert.ToString(objMO["Description"])) + Environment.NewLine;
          }
  </code></pre>
  
  <p>Above code gives no information about type of network (wifi or wired)</p>
  
  <p><code>NetworkInterface</code> class:</p>
  
  <pre><code>foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
  
          {
              this.textBox1.Text += nic.Name.ToString();    
  
              this.textBox1.Text += "MAC: " + nic.GetPhysicalAddress().ToString();
  
              this.textBox1.Text += "Type: " + nic.NetworkInterfaceType;
              this.textBox1.Text += "Description: " + nic.Description.ToString();
              this.textBox1.Text += "OperationalStatus: " + nic.OperationalStatus.ToString() + ;
          }
  </code></pre>
  
  <p>Above code gives me list of Ethernet LAN description.
  even NetworkInterfaceType for wifi LAN is showing as Ehternet, e.g:
     Type: Ethernet
     Description: Intel(R) Centrino(R) Ultimate-N 6300 AGN - Packet Scheduler Miniport</p>
  
  <p>I mean there no way to differentiate which one is wireless or wired network.</p>
  
  <p>I have also tried <strong><code>NativeWifi.WlanClient</code></strong>, but it crashes.</p>
  
  <pre><code>  Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
          foreach (Wlan.WlanAvailableNetwork network in networks)
          {   
              if (network.dot11DefaultCipherAlgorithm == Wlan.Dot11CipherAlgorithm.WEP)
              {
                  this.textBox1.Text = string.Format("Found WEP network with SSID {0}: ", GetStringForSSID(network.dot11Ssid)) + Environment.NewLine;
              }
          }
  </code></pre>
  
  <p>Any guidance will be appreciated. 
  Thanks</p>