public InetAddress[] getLocalIPs()
{
InetAddress[] mArLocalIP = null;
if(mArLocalIP == null)
{
try
{
mArLocalIP = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
}
catch(Exception e)
{System.out.println("getHostIP error");}
}
return mArLocalIP;
}
Java中获取本地IP地址
最新推荐文章于 2024-08-23 15:54:50 发布