import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ManagerArgs{
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec("ping 192.168.1.86");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = br.readLine()) != null) {
System.out.println(line);
System.out.println("I call 有数据耶!");
}
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
import java.io.IOException;
import java.io.InputStreamReader;
public class ManagerArgs{
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec("ping 192.168.1.86");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = br.readLine()) != null) {
System.out.println(line);
System.out.println("I call 有数据耶!");
}
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}