How to resolve the host / machine name with an IP address on windows phone

kingmiddle

New member
Jun 2, 2011
13
0
0
Visit site
Hello people from wpcentral. Anyone know if it can recover the ( hostname/machine name ) with a local IP address ? I know that the resolution reverse 'hostname -> ip' works perfectly with `DeviceNetworkInformation.ResolveHostNameAsync (endpoint, OnNameResolved, null).`
Is it possible to do the same thing but in reverse? Given the IP of a Local Machine and retrieve its hostname? A thousand thanks
**Here is my code** , but it's doesn't work the host is always called **"192.168.1.5"** like the ip . And it's should return **"computer0001"**
Code:
    DeviceNetworkInformation.ResolveHostNameAsync("192.168.1.5", OnNameResolved, null);
    
    private void OnNameResolved(NameResolutionResult result)
    {
         IPEndPoint[] endpoints = result.IPEndPoints;
         if (endpoints != null)
         {
             if (endpoints.Length > 0)
             {
                 //Host always return ip adress and not the machine name
                 host = endpoints[0].ToString();
             }
         }
     }
 

Members online

Forum statistics

Threads
323,300
Messages
2,243,598
Members
428,055
Latest member
DrPendragon