473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

StandardOutput Redirect problem.

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()
Jul 21 '05 #1
0 1510

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Lewin | last post by:
I've recently discovered the value of using existing console applications in managed .net apps. Unfortunately, I've stumbled into a problem with a particular console application that check's crc...
1
by: JC | last post by:
I'm trying to create a GUI wrapper for dumpbin, and so I'm using the Process class to run the command-line application. The problem is that if I use Readline() to get the output from the...
1
by: Jean Harris | last post by:
If I redirect the console output using the standard method, it works fine if the process outputs all its information and then exits quite soon. But for processes that output information as they are...
5
by: vijaynats | last post by:
Hi I created a windows app to run a dos batch file (which takes around 5mins to complete and generates lots of output messages on the console in the meantime)and i used RedirectStandardOuput to...
1
by: Franco Gustavo | last post by:
How can redirect the standard output to a file from inside the same process. It can be easily done if one process launches another process with startinfo.RedirectStandardOutput to true. ...
4
by: Eric ST | last post by:
Hi there, I run a process that run ftp.exe -s i get the StandardOutput this way : ftpProgram = Process.Start(ftpProgram.StartInfo) Output = ftpProgram.StandardOutput.ReadToEnd...
6
by: darren | last post by:
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...
0
by: Alison | last post by:
Hi, all, I started an application by using process and wanted to redirect the output to a textbox in VB .Net. I used newprocess.standoutput.readline since I wanted the display to be timely . The...
0
by: darren | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.