Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:10:10+00:00 2026-06-13T18:10:10+00:00

I got a problem synchronizing the IP address and Description. The objective is this:

  • 0

I got a problem synchronizing the “IP address and Description”.

The objective is this:

Get the IP address and what is the description?

Example:

| Atheros Azx1234 Wireless Adapter |

|192.168.1.55                      |

But the outcome is not what I expected…

This is my code feel free to try…

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") && // I have a problem with this condition
                (ip.AddressFamily == AddressFamily.InterNetwork))
            {
                MessageBox.Show(ip.ToString(), adapter.Description.ToString());
            }
        }
    }
}

How can I fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:10:12+00:00Added an answer on June 13, 2026 at 6:10 pm

    The problem in your code is that you do not use the associated IP addresses
    for the given adapter. Instead of matching all IP addresses to every adapter
    use only the IP addresses associated with the current adapter:

    NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
    foreach (var adapter in interfaces)
    {
        var ipProps = adapter.GetIPProperties();
    
        foreach (var ip in ipProps.UnicastAddresses)
        {
            if ((adapter.OperationalStatus == OperationalStatus.Up)
            && (ip.Address.AddressFamily == AddressFamily.InterNetwork))
            {
                Console.Out.WriteLine(ip.Address.ToString() + "|" + adapter.Description.ToString());
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

got a problem, can't get my head around this jquery and would appreciate your
I got problem with sending data in Android using httpPost. I found some example,
I have got problem with this method: public List<int> menu_wid_w_kat() { DataSet1TableAdapters.menu_widac_wszystkoTableAdapter pk =
I've got problem with Listview in Android. Then I try to set adapter to
I've got problem with this peace of code, it should change lower case letters
I think my apache webserver has got problem. I can't reference jquery.js I get
I got problem with this code: if (!empty($_GET[ lic ])) $lic = $_GET[ lic
i got problem with my code , i am trying to get image from
I've got problem with dropping foreign key index, I always get the same error
I've got problem with keyboard focus . This is how it works now (not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.