I've been using the following code to return an IP (v4) from a host name. However, this doesn't work on Vista IPv6 address returns.
Q. How can I change this code to detect the OS and find the IP per Host name accordingly?
private IPAddress GetIP()
IPAddress thisIp = null;
string strHostName = Dns.GetHostName();
IPHostEntry iphostentry = Dns.GetHostEntry(strHostName);// Find host name
foreach (IPAddress ipAddress in iphostentry.AddressList)// Grab the first IP addresses
thisIp = ipAddress;