【发布时间】:2010-04-09 13:36:24
【问题描述】:
我正在制作一个可用于编辑、编译和运行 C 程序的 VB.NET 应用程序。我使用了 Process.StartInfo.RedirectStandardOutput 属性。但我无法将它重定向到文本框,因为它不是字符串类型。
如何将来自 cl.exe 进程的输出重定向到我的文本框?
【问题讨论】:
标签: c vb.net redirect process cl.exe
我正在制作一个可用于编辑、编译和运行 C 程序的 VB.NET 应用程序。我使用了 Process.StartInfo.RedirectStandardOutput 属性。但我无法将它重定向到文本框,因为它不是字符串类型。
如何将来自 cl.exe 进程的输出重定向到我的文本框?
【问题讨论】:
标签: c vb.net redirect process cl.exe
您需要重定向到 TextBox 的 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
【讨论】: