Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
		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;	
		}