var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in host.AddressList)
{
var localIp = ip.ToString();
var temp = localIp.Split('.');
switch (ip.AddressFamily)
{
case AddressFamily.InterNetwork when temp[0] == "192":
return localIp;
}
}
return "127.0.0.1";