how to get the network interface and its right ipv4 address?
I need to know how to get every network interface with its ipv4 address. <i>or just wireless and ethernet.</i>

<br> i know that if i want to get all network interfaces details i use this :

    foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
            {
               if(ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
                 {
                      Console.WriteLine(ni.Name);
                 }  
            }

and to get the all hosted ipv4 addresses of the computer

            IPAddress [] IPS = Dns.GetHostAddresses(Dns.GetHostName());
            foreach (IPAddress ip in IPS)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                    Console.WriteLine("IP address : " + ip);
            }

but how to get the network interface and its right ipv4 address?
how to get the network interface and its right ipv4 address?
===

I need to know how to get every network interface with its ipv4 address. <i>or just wireless and ethernet.</i>

<br> i know that if i want to get all network interfaces details i use this :

    foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
            {
               if(ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
                 {
                      Console.WriteLine(ni.Name);
                 }  
            }

and to get the all hosted ipv4 addresses of the computer

            IPAddress [] IPS = Dns.GetHostAddresses(Dns.GetHostName());
            foreach (IPAddress ip in IPS)
            {
                if (ip.AddressFamily == AddressFamily.InterNetwork)
                    Console.WriteLine("IP address : " + ip);
            }

but how to get the network interface and its right ipv4 address?