public static string GetLocalIPAddress()
{
IPHostEntry host;
string localIP = "";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork && ip.ToString().StartsWith("192."))
{
localIP = ip.ToString();
break;
}
}
return localIP;
}
#endif