private String
executeCommand(String command) throws Exception {
StringBuffer runShellResult = new StringBuffer();
Process p =
Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line
= "";
while ((line =
reader.readLine()) != null) {
runShellResult.append(line + "\n");
}
return
runShellResult.toString();
}
沒有留言:
張貼留言