Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes - create the process using <a href="http://msdn.microsoft.com/en-us/library/0w4h05yb.aspx" rel="nofollow noreferrer"><code>Process.Start(ProcessStartInfo)</code></a> having set <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx" rel="nofollow noreferrer"><code>RedirectStandardOutput</code></a> (and potentially <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandarderror.aspx" rel="nofollow noreferrer"><code>RedirectStandardError</code></a>) to true and <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.useshellexecute.aspx" rel="nofollow noreferrer"><code>UseShellExecute</code></a> to false on the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.aspx" rel="nofollow noreferrer"><code>ProcessStartInfo</code></a> describing the process you want to start.</p> <p>You can then either read directly from <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx" rel="nofollow noreferrer"><code>Process.StandardOutput</code></a> and <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standarderror.aspx" rel="nofollow noreferrer"><code>Process.StandardError</code></a> (in separate threads, so that nothing blocks if the process fills its output buffer) or subscribe to the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.outputdatareceived.aspx" rel="nofollow noreferrer"><code>Process.OutputDataReceived</code></a> event and call <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.beginoutputreadline.aspx" rel="nofollow noreferrer"><code>Process.BeginOutputReadLine</code></a> (and the equivalent for standard error). MSDN has samples of all of this.</p> <p>Note that in any case, you'll be receiving data on a different thread to the UI thread, so you'll want to use <code>Control.Invoke</code> / <code>Control.BeginInvoke</code> to marshal back to the UI thread before appending the text to the TextBox.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload