public static bool SetRemoteIP(string remoteAddress)
{
try
{
IPAddress address;
if (IPAddress.TryParse(remoteAddress, out address))
{
Netplay.ServerIP = address;
Netplay.ServerIPText = address.ToString();
return true;
}
IPAddress[] addressList = Dns.GetHostEntry(remoteAddress).AddressList;
for (int index = 0; index < addressList.Length; ++index)
{
if (addressList[index].AddressFamily == AddressFamily.InterNetwork)
{
Netplay.ServerIP = addressList[index];
Netplay.ServerIPText = remoteAddress;
return true;
}
}
}
catch
{
return false;
}
return false;
}