The text of this article is not in this database — only its details are. Read it on the old site: Get IP Address Using C#
14 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Get IP Address Using C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Doug RoyerPosted Apr 15, 2024, 6:49 PM
That get the first it finds, which can be the loopback addresses 127.0.0.1 and ::1.
Kent KakoraPosted Dec 20, 2022, 12:40 PM
The GetHostByName is now obsolete
prideaux90Posted Nov 20, 2020, 11:42 PM
Why do you assume the first entry [0] is the correct local IP? you may get MULTIPLE local ip addresses if for example if have Ethernet vs Wireless, installed a Virtual Machine, ipV4, ipV6,
Esteban Serrano SeguraPosted May 30, 2019, 2:03 PM
Tengo una duda tengo una pagina web publicada y debo obtener la ip pero de la maquina local , pero cuando ejecuto el comando me obtiene la ip de la maquina en que esta publicada
mhamd abdPosted Dec 12, 2018, 3:50 PM
Have you Idea how to get the IP internet?
Anslemo PelcastrePosted Oct 23, 2018, 5:25 PM
Hi, I need to obtain the ip address but of client using asp mvc net core2.0, do you have a example for this please ?
Mohnish PandyaPosted Jul 4, 2018, 12:15 AM
How to make sure that one with zero index will be primary IP?
ERP TestingPosted Dec 22, 2016, 11:26 PM
This code is running in local system but when host it then it return always server ip
Praveen KumarPosted Sep 18, 2015, 7:11 AM
Nice
Vaikesh K PPosted Aug 25, 2015, 4:41 AM
Good info :)
John JuanPosted Aug 25, 2015, 4:38 AM
how to get ip address of other computers in the LAN?
Brijendra GautamPosted Mar 14, 2014, 12:01 AM
Dns.GetHostByName is obsolated by MicroSoft instead you can use Dns.GetHostEntry or Dns.GetHostAddresses both will give all the IP address associate with the HostName.