Use hostname instead of the ip.

This commit is contained in:
Alexander Eckart committed 2013-12-23 11:46:03 +01:00
1 parent 9d73d6b532
commit d9b8d54eb9
1 file changed
+4 -2
+4 -2
View File
@@ -205,13 +205,15 @@ namespace ServerLib
public static string GetLocalAddress()
{
IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
return Dns.GetHostName();
/*IPAddress[] ips = Dns.GetHostAddresses(Dns.GetHostName());
foreach (IPAddress ip in ips)
{
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
return ip.ToString();
}
return "";
return "";*/
}
#region server control