string Myhost = System.Net.Dns.GetHostName(); string myIP = System.Net.Dns.GetHostAddresses(Myhost)[0].Address.ToString();