views:

191

answers:

1

I was making a VB.NET application that can be used to edit, compile and run C programs. I used the Process.StartInfo.RedirectStandardOutput property. But I'm unable to redirect it to a textbox, since it is not of the string type.

How do I redirect the output coming from the cl.exe process to my textbox?

+1  A: 

You need to redirect into the TextBox's Text property. For example:

Dim proc As New Process
proc.StartInfo = New ProcessStartInfo("tracert.exe", "10.0.0.138") _
                 With {.RedirectStandardOutput = True, .UseShellExecute = False}
proc.Start()
TextBox1.Text = proc.StandardOutput.ReadToEnd
M.A. Hanin
ProcessStartInfo("tracert.exe", "10.0.0.138") - Can you please tell me what all are the parameters that we pass on to this function named ProcessStartInfo.
Arjun Vasudevan
First is path ro file, second is command-line-arguments. See complete list of methods, including constructors, here: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo_members.aspx
M.A. Hanin