Redirect output from a process
-
Hi all, I have a process that run lame.exe to encode an mp3. What I am trying to do is catch the ouput from lame and display it in a textbox. So what i did was this:
'create a new process Dim p As New Process() p.StartInfo.RedirectStandardOutput = True p.StartInfo.UseShellExecute = False p.StartInfo.FileName = "C:\Lame\encoder.bat" p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden p.Start() p.WaitForExit() mainForm.txtResult.Text = p.StandardOutput.ReadToEnd p.Close()
This doesn't produce any errors, but it doesn't work either. I basically just want to show the user that something is happening. Ideally I would like to have a progressbar but i can't think of a way to measure the progress of the process. Anyway, if you can help that would be much appreciated.:) /** * @author Jachin */