G
Guest
I have a perl script that I am calling from vb.net as a process. I need to get the standard
output and display it in a text box. The problem I am having is that extra blank lines are
being added to the standard output, 2 of them per line. I have no idea why - and if I
run the same script in the command line the output is normal (no extra 2 lines per line).
Can someone point me in the right direction? Thanks.
Dim MyProcess As New Process
MyProcess.StartInfo.UseShellExecute = False
'redirect the standard output
MyProcess.StartInfo.RedirectStandardOutput = True
'do not create a command window
MyProcess.StartInfo.CreateNoWindow = True
'set the file name
MyProcess.StartInfo.FileName = "c:\perl\bin\perl.exe"
MyProcess.StartInfo.Arguments = "e:\test_template.pl"
'start the process
MyProcess.Start()
'grab the contents of the standard output
Dim srOut As StreamReader = MyProcess.StandardOutput
Dim sOut As String = srOut.ReadToEnd
txtText = sOut
'wait until the program exits
MyProcess.WaitForExit()
output and display it in a text box. The problem I am having is that extra blank lines are
being added to the standard output, 2 of them per line. I have no idea why - and if I
run the same script in the command line the output is normal (no extra 2 lines per line).
Can someone point me in the right direction? Thanks.
Dim MyProcess As New Process
MyProcess.StartInfo.UseShellExecute = False
'redirect the standard output
MyProcess.StartInfo.RedirectStandardOutput = True
'do not create a command window
MyProcess.StartInfo.CreateNoWindow = True
'set the file name
MyProcess.StartInfo.FileName = "c:\perl\bin\perl.exe"
MyProcess.StartInfo.Arguments = "e:\test_template.pl"
'start the process
MyProcess.Start()
'grab the contents of the standard output
Dim srOut As StreamReader = MyProcess.StandardOutput
Dim sOut As String = srOut.ReadToEnd
txtText = sOut
'wait until the program exits
MyProcess.WaitForExit()