System.Diagnostics.Process: avoid deadlocks in RedirectStandardInput/Output (Lucian Wischik)
Posted by: The Visual Basic Team,
on 30 Dec 2008 |
View original | Bookmarked: 0 time(s)
It's common that you want to launch an external process but supply input and capture the output. Here's one attempt:
' BAD CODE
Using p As New System.Diagnostics.Process
p.StartInfo.FileName = "cat"
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.RedirectStandardInput = True
p.Start()
p.StandardInput.Write("world" & vbCrLf...