IPGlobalProperties ipInfo = IPGlobalProperties.GetIPGlobalProperties();
TcpConnectionInformation[] ipStaticIp4 = ipInfo.GetActiveTcpConnections();
if (ipStaticIp4.Length == 0)
LoginUser.IP = "127.0.0.1";
else
{
System.Net.IPEndPoint localEndPoint = ipStaticIp4[0].LocalEndPoint;
string localIp = localEndPoint.Address.ToString();
LoginUser.IP = localIp;
}