Moved local ip to library
This commit is contained in:
@@ -99,5 +99,20 @@ namespace ErgometerLibrary
|
|||||||
|
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IPAddress GetIP()
|
||||||
|
{
|
||||||
|
IPHostEntry host;
|
||||||
|
string localIP = "?";
|
||||||
|
host = Dns.GetHostEntry(Dns.GetHostName());
|
||||||
|
foreach (IPAddress ip in host.AddressList)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == AddressFamily.InterNetwork)
|
||||||
|
{
|
||||||
|
localIP = ip.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return GetIP(localIP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user