我正在做一个可以用来编辑,编译和运行C程序的VB.NET应用程序。 我用Process.StartInfo.RedirectStandardOutput属性。 但我不能将其重定向到一个文本框,因为它是字符串类型的不是。
如何重定向输出从过程的cl.exe我的文本框来吗?
我正在做一个可以用来编辑,编译和运行C程序的VB.NET应用程序。 我用Process.StartInfo.RedirectStandardOutput属性。 但我不能将其重定向到一个文本框,因为它是字符串类型的不是。
如何重定向输出从过程的cl.exe我的文本框来吗?
您需要重定向到文本框的Text属性。 例如:
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