Avatar of npcs
npcs

asked on 

displaying ipv4 from vista in a label while also showing ipv4 from xp in same feild in VB.NET

I need to be able to show the local computers ipv4 Ip address on xp and vista. At the moment i am using :

strIPAddress = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()

but this returns the ipv6 address in vista... any ideas? I was thinking of doing something like:

if xp then
    strIPAddress = System.Net.Dns.GetHostEntry(strHostName).AddressList(0).ToString()
else if vista
   whatever i need to do to get the vista address
else
   strIPAddress = "Unknown Operating system"
end if

(very simplified version of course)
Visual Basic.NETWindows XPWindows Vista

Avatar of undefined
Last Comment
npcs

8/22/2022 - Mon