IP地址中的Java / Android的的NetBIOS / FQDN名称 [英] Ip address to NetBIOS/FQDN name in Java/Android

查看:740
本文介绍了IP地址中的Java / Android的的NetBIOS / FQDN名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给我的Andr​​oid设备在同一网络上的计算机的IP地址,我一定要找到它的NetBIOS / FQDN名字......有没有干净的解决方案,以实现这一目标的Andr​​oid SDK和一般来说在java中?

given the ip address of a computer on the same network of my Android device, i have to find its NetBIOS/FQDN name ... is there any "clean" solution to accomplish this with the Android SDK and generally speaking in java ?

显然InetAddress.get *主机名不返回的NetBIOS名称:)

Obviously InetAddress.get*HostName does not return the NetBIOS name :)

推荐答案

您可以使用<一个href="http://www.jarvana.com/jarvana/view/org/samba/jcifs/jcifs/1.2.19/jcifs-1.2.19-javadoc.jar!/jcifs/netbios/NbtAddress.html"相对=nofollow> JCIFS 的开源库。

 InetAddress addr = NbtAddress.getByName( "hostname" ).getInetAddress();

是双向的,IP地址,主机名,反之亦然。

works both ways, ip address to hostname and vice versa.

这篇关于IP地址中的Java / Android的的NetBIOS / FQDN名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆