Try this
To get the IP address of the local machine in C#,
using system.net namespace
From IPHostEntry class, we get the list in a string array.
using System.Net;
Private string GetIP()
{
string strHostName = "";
strHostName = System.Net.Dns.GetHostName();
IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
IPAddress[] addr = ipEntry.AddressList;
return addr[addr.Length-1].ToString();
}
Thanks
SP