Beispiel #1
0
 public static int Command(string command, string arguments)
 {
     ConsoleProcess proc = new ConsoleProcess();
     proc.Arguments = arguments;
     proc.AppFileName = command;
     proc.Start();
     proc.Wait();
     return proc.ExitCode;
 }
Beispiel #2
0
        public static int Command(string command, string arguments)
        {
            ConsoleProcess proc = new ConsoleProcess();

            proc.Arguments   = arguments;
            proc.AppFileName = command;
            proc.Start();
            proc.Wait();
            return(proc.ExitCode);
        }
Beispiel #3
0
 public static int Command(string command, string arguments, IList<string> stdoutAndErr)
 {
     ConsoleProcess proc = new ConsoleProcess();
     proc.Arguments = arguments;
     proc.AppFileName = command;
     proc.StderrLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
     proc.StdoutLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
     proc.Start();
     proc.Wait();
     return proc.ExitCode;
 }
Beispiel #4
0
        public static int Command(string command, string arguments, IList <string> stdoutAndErr)
        {
            ConsoleProcess proc = new ConsoleProcess();

            proc.Arguments       = arguments;
            proc.AppFileName     = command;
            proc.StderrLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
            proc.StdoutLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
            proc.Start();
            proc.Wait();
            return(proc.ExitCode);
        }