if(value.equals("true")) System.out.println(key+"-->"+value); } } class PingIp extends Thread{ public String ip; // IP public PingIp(String ip){ this.ip=ip; }
public void run(){ try{ Process p= Runtime.getRuntime().exec ("ping "+ip+ " -w 300 -n 1"); InputStreamReader ir = new InputStreamReader(p.getInputStream()); LineNumberReader input = new LineNumberReader (ir); //读取结果行 for (int i=1 ; i <7; i++) input.readLine(); String line= input.readLine();