I am trying to get the IP address of client machine using C#. I am using the below code to get the IP address :
string IPAddress = HttpContext.Current.Reque
In my project it's required to get the local PC IP. So i use it Please try the below code
string strHostName = System.Net.Dns.GetHostName(); IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName); IPAddress[] addr = ipEntry.AddressList; string ip = addr[1].ToString();