package javai;

import java.io.BufferedReader;

import java.io.InputStreamReader;

public class IOTest {

    public static void main(String[] args) {
        try {
            Process pro = Runtime.getRuntime().exec("ping www.baidu.com");
            String line;
            BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));
            while ((line = buf.readLine()) != null)
                System.out.println(line);
        } catch (

        Exception e)

        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}

 

 

 

 


正在 Ping www.a.shifen.com [220.181.111.188] 具有 32 字节的数据:
来自 220.181.111.188 的回复: 字节=32 时间=28ms TTL=54
来自 220.181.111.188 的回复: 字节=32 时间=28ms TTL=54
来自 220.181.111.188 的回复: 字节=32 时间=28ms TTL=54
来自 220.181.111.188 的回复: 字节=32 时间=28ms TTL=54

220.181.111.188 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 28ms,最长 = 28ms,平均 = 28ms

相关文章:

  • 2022-02-27
  • 2022-03-02
  • 2022-01-20
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
猜你喜欢
  • 2021-08-12
  • 2022-02-12
  • 2021-11-12
  • 2021-12-18
  • 2022-12-23
  • 2021-11-30
  • 2021-12-10
相关资源
相似解决方案