title: Get IP address and adapter description using C#
body: <p>I got a problem synchronizing the "IP address and Description".</p>
  
  <p>The objective is this:</p>
  
  <p>Get the IP address and what is the description?</p>
  
  <p>Example:</p>
  
  <pre><code>| Atheros Azx1234 Wireless Adapter |
  
  |192.168.1.55                      |
  </code></pre>
  
  <p>But the outcome is not what I expected...</p>
  
  <p>This is my code feel free to try...</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
      IPHostEntry host;
      host = Dns.GetHostEntry(Dns.GetHostName());
  
      foreach (NetworkInterface adapter in interfaces)
      {
          foreach (IPAddress ip in host.AddressList)
          {
              if ((adapter.OperationalStatus.ToString() == "Up") &amp;&amp; // I have a problem with this condition
                  (ip.AddressFamily == AddressFamily.InterNetwork))
              {
                  MessageBox.Show(ip.ToString(), adapter.Description.ToString());
              }
          }
      }
  }
  </code></pre>
  
  <p>How can I fix this problem?</p>