I'm using Xamarin Studio to develop to iOS and I need a couple of functions to get the Computer Name from the IP and vice-versa
I've tried this code to get the machine name from IP
string machineName = string.Empty;
try
{
IPHostEntry hostEntry = Dns.GetHostEntry(ipAdress);
machineName = hostEntry.HostName;
}
catch (Exception ex)
{
// Machine not found...
}
return machineName;
But I keep getting the machine IP Address, so it's useless because I input the IP Address and get the IP Address.
I've tried something alike to get the IP Address from the HostName I always get the exception "Unable to resolve hostname HITMAN-DESKTOP" being the HITMAN-DESKTOP my remote machine that is accessible from any point in the network and online during the tests.
Any ideas?