C# Capture Process Output

Date: 2021-06-10
var executablePath = GetFilePathFromAssemblyRoot("Converter.exe");

var converterProcess = new Process
{
	StartInfo = new ProcessStartInfo
	{
		FileName = executablePath,
		Arguments = "\"" + filePath + "\"",
		UseShellExecute = false,
		RedirectStandardOutput = true,
		StandardOutputEncoding = Encoding.Default,
		CreateNoWindow = true
	}
};
converterProcess.Start();
converterProcess.WaitForExit();

var result = converterProcess.StandardOutput.ReadToEnd();
51100cookie-checkC# Capture Process Output