如何使用java程序在局域网中找到远程计算机的ip地址 [英] how to find out ip address of remote computer in lan using java program
本文介绍了如何使用java程序在局域网中找到远程计算机的ip地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要提供局域网中远程PC的IP地址的方法吗?
i want method which gives ip addresses of remote pcs those are in LAN?
推荐答案
Monalisa,
试试这个:
Hi Monalisa,
try this:
InetAddress inetAddress = InetAddress.getByName("www.google.com");
byte[] raw = inetAddress.getAddress();
字节数组现在包含IP地址字节.
干杯
曼弗雷德(Manfred)
The byte array now contains the IP addresses bytes.
Cheers
Manfred
当天我的第三个您搜索过Google"答案. :doh:
请参见: Google搜索-ip地址java [
My third "have you searched Google" answer for the day. :doh:
See this: Google search - ip address java[^]
这篇关于如何使用java程序在局域网中找到远程计算机的ip地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文