简体   繁体   中英

How to resolve NetBIOS name for a given IP-address on Windows Phone 8

I use this code:

string Address = "192.168.0.1";
DnsEndPoint hostEntry = new DnsEndPoint(Address, 80);
DeviceNetworkInformation.ResolveHostNameAsync(hostEntry, new NameResolutionCallback(nrr =>
{
if (Address == nrr.HostName)
{
    HostName = "unknown host";
}
else
{
    HostName = nrr.HostName;
}
}), null);

And HostName always is "unknown host". Please tell me, where is my mistake.

Looks like your problem is that in your average home environment you do not have DNS servers at all so your not going to be resolving internal IP addresses of your home computers using DNS. You'll need to use NetBIOS names for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM