int read; //实现ping命令
try {
Process ps = Runtime.getRuntime().exec("ping 127.0.0.1");
InputStream is = ps.getInputStream();
while ( (read = is.read()) != -1) {
System.out.print( (char) read);
}
}
catch (IOException ex) {
ex.printStackTrace();
}
try { //用ie打开网页
String str = "E://java-api//index.html";
Runtime.getRuntime().exec("explorer " + str);
}
catch (IOException ex) {
ex.printStackTrace();
}
try {
Process ps = Runtime.getRuntime().exec("ping 127.0.0.1");
InputStream is = ps.getInputStream();
while ( (read = is.read()) != -1) {
System.out.print( (char) read);
}
}
catch (IOException ex) {
ex.printStackTrace();
}
try { //用ie打开网页
String str = "E://java-api//index.html";
Runtime.getRuntime().exec("explorer " + str);
}
catch (IOException ex) {
ex.printStackTrace();
}