string sDeviceID = System.Net.Dns.GetHostName();
System.Net.IPHostEntry hostEntry = System.Net.Dns.GetHostEntry(sDeviceID);
string sIPAddress = string.Empty;
for (int index = 0; index < hostEntry.AddressList.Length; index++)
{
sIPAddress = hostEntry.AddressList[index].ToString();
}