C# Getting your IP address

Sometimes you need to know your ip address in code. With the following snippet you can!

 var hostName= new HostInformation();  
 var address = Dns.GetHostEntry(hostName).AddressList[0].ToString();  

Comments

Popular posts from this blog

String.Replace vs Regex.Replace

C# Producer Consumer using Rabbit MQ

C# Form Application in Kiosk Mode/Fullscreen