import java.io.*;
import java.lang.*;
public class Ping {
public Ping() {
}
public static void main(String args[])
{
if (args.length < 1)
{
System.out.println("syntax Error!");
}
else
{
String line = null;
try
{
Process pro = Runtime.getRuntime().exec("ping " + args[0]);
BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));
while((line = buf.readLine()) != null)
System.out.println(line);
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
}
阅读(694) | 评论(0) | 转发(0) |