示例#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);
        }
示例#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;	
		}