How do I get only Internet Protocol version 4 addresses from Dns.GetHostAddresses()? I have the code below, and it gives me IPv4 and IPv6 addresses. I have to m
Dns.GetHostAddresses()
Here is a code to find the first connected IPv4 by using for loop :
IPAddress ipAddress = null; IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName()); for (int i=0 ; i