private void AttachOutputRedirection(PROCESS_INFORMATION processInformation)
        {
            Process process = Process.GetProcessById((int)processInformation.dwProcessId);

            process.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);
            process.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);

            process.BeginOutputReadLine();
            process.BeginErrorReadLine();
        }
Esempio n. 2
0
 static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes,
                                 IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags,
                                 IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo,
                                 out PROCESS_INFORMATION lpProcessInformation);
Esempio n. 3
0
 public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes,
                                         bool bInheritHandles, ProcessCreationFlags dwCreationFlags, IntPtr lpEnvironment,
                                         string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);