FixGetIp
This commit is contained in:
parent
d95c65c12c
commit
6c07557deb
1 changed files with 3 additions and 2 deletions
|
@ -53,8 +53,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static IPAddress GetIp()
|
public static IPAddress GetIp()
|
||||||
{
|
{
|
||||||
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
||||||
string myIP = Dns.GetHostByName(hostName).AddressList[1].ToString();// Get the IP
|
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||||
|
string myIP = ipList[ipList.Count()-1].ToString();// Get the IP
|
||||||
return IPAddress.Parse(myIP);
|
return IPAddress.Parse(myIP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue