Java打开外部程序RuntimeProcess
发布时间:2010/6/29 11:16:36 来源:城市学习网 编辑:ziteng
Runtime r = Runtime.getRuntime();
try {
proc = r.exec("cmd /c" + command);
System.out.println(command + "-->cmd");
InputStream is = proc.getInputStream();
byte[] b = new byte[1024];
is.read(b);
result.add(new String(b));
} catch (IOException e) {
e.printStackTrace();
}