System.Diagnostics.Process: redirect StandardInput, StandardOutput, StandardError

Sometimes you want to launch an external utility and send input to it and also capture its output. But it’s easy to run into deadlock this way… ‘ 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”…

1