public static int RunProc(string[] cmd) { java.lang.Runtime rt = java.lang.Runtime.getRuntime(); java.lang.Process proc = rt.exec(cmd); StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); errorGobbler.start(); outputGobbler.start(); int exitVal = proc.waitFor(); return(exitVal); }
public static int RunProc(string[] cmd) { java.lang.Runtime rt = java.lang.Runtime.getRuntime(); java.lang.Process proc = rt.exec(cmd); StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); errorGobbler.start(); outputGobbler.start(); int exitVal = proc.waitFor(); return exitVal; }