ANHAdmin.ProcessCaller.StartProcess C# (CSharp) Method

StartProcess() protected method

This method is generally called by DoWork() which is called by the base classs Start()
protected StartProcess ( ) : void
return void
        protected virtual void StartProcess()
        {
            // Start a new process for the cmd
            process = new Process();
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.RedirectStandardError = true;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.FileName = m_FileName;
            process.StartInfo.Arguments = m_Arguments;
            //            process.StartInfo.WorkingDirectory = WorkingDirectory;
            process.Start();

            // Invoke stdOut and stdErr readers - each
            // has its own thread to guarantee that they aren't
            // blocked by, or cause a block to, the actual
            // process running (or the gui).
            new MethodInvoker(ReadStdOut).BeginInvoke(null, null);
            new MethodInvoker(ReadStdErr).BeginInvoke(null, null);
        }