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# Form Application in Kiosk Mode/Fullscreen

Javascript numeric only text box