InetAddress inet = InetAddress.getByName("www.baidu.com");
System.out.println(inet.isReachable(100000000));
这是一段验证是否可与服务器建立连接的程序,为什么我连不上百度???
求懂得人帮解答
InetAddress inet = InetAddress.getByName("www.baidu.com");
System.out.println(inet.isReachable(100000000));
这是一段验证是否可与服务器建立连接的程序,为什么我连不上百度???
求懂得人帮解答
换成InetAddress.getHostAddress方法试试