首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

依据 IP 查找机器名

2012-10-14 
根据 IP 查找机器名ping -a localhostInetAddress addr InetAddress.getByName(16.173.244.212)// Ge

根据 IP 查找机器名

ping -a localhost


InetAddress addr = InetAddress.getByName("16.173.244.212");            // Get the host name        String hostname = addr.getHostName();        System.out.println(hostname);        // Get canonical host name        String hostnameCanonical = addr.getCanonicalHostName();

热点排行