Is it possible to determine your IP through a C # program? Preferably local IP and external. And, if it is possible to find out through a router, how? Can you tell in which direction to dig or sample code to show me?
2 answers
Maybe:
foreach (System.Net.IPAddress ip in System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList) { Console.WriteLine(ip.ToString()); }
These are local addresses.
- Thank you) - handbat0
|
No one except the router knows the external IP, so the only way to find it out is to ask your IP from someone behind the router, for example, http://www.myip.ru/ru-RU/index.php
|