繁体   English   中英

如何在Windows Phone 8上为给定IP地址解析NetBIOS名称

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

我使用以下代码:

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);

并且HostName始终是“未知主机”。 请告诉我,我的错误在哪里。

看起来您的问题是,在一般的家庭环境中,您根本没有DNS服务器,因此您将无法使用DNS解析家庭计算机的内部IP地址。 您需要为此使用NetBIOS名称。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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