I want to get the ping execution time and result in string after ping host

前端 未结 4 1982
醉梦人生
醉梦人生 2021-01-13 14:10

I want to get the ping execution time and result in string after ping host. How can I do it?

4条回答
  •  生来不讨喜
    2021-01-13 14:17

    did you check this http://docs.oracle.com/javase/1.4.2/docs/guide/nio/example/Ping.java

    and

    http://www.java2s.com/Code/JavaAPI/java.net/InetAddressisReachableinttimeout.htm

提交回复
热议问题