IPAddress[] addresses = Dns.GetHostEntry(Dns.GetHostName()).AddressList;
The code above retrieves the IP addresses for each connected network adapter of the device. The Dns and IPAddress classes belong to the System.Net namespace.
This blog is moved to a new home - https://christianhelle.com
IPAddress[] addresses = Dns.GetHostEntry(Dns.GetHostName()).AddressList;
1 comment:
thank you, very useful!
Post a Comment