Hello all. I am a newbie for c #. I am trying to write a windows application in c # that will invoke a perl script with some arguments and I want the output of the perl script to be displayed onto a label of a c # form. I am using System.Diagnostics.Process class to achive this. Now for me to redirect the stdout, this class requires me to turnoff shell execute (Process.StartInfo.UseShellExecute=false. If I do this it gives me error saying not a win32 application which I undestand its not. If I don't set it to false it can't do the redirection. Is there any other way to achive this?
Any help is greatly appreciated.
Thanks,
Kedar
Here is the code snipplet I am using.
this.output.Text="Running the process....";
Process perlproc = new Process();
perlproc.StartInfo.WorkingDirectory=@"C:\Documents and Settings\Owner\My Documents";
perlproc.StartInfo.FileName=@"hello.pl";
perlproc.StartInfo.CreateNoWindow=true;
perlproc.EnableRaisingEvents=true;
perlproc.Exited +=new System.EventHandler (this.Process_Exited);
perlproc.StartInfo.UseShellExecute=false;
perlproc.StartInfo.RedirectStandardOutput=true;
Any help is greatly appreciated.
Thanks,
Kedar
Here is the code snipplet I am using.
this.output.Text="Running the process....";
Process perlproc = new Process();
perlproc.StartInfo.WorkingDirectory=@"C:\Documents and Settings\Owner\My Documents";
perlproc.StartInfo.FileName=@"hello.pl";
perlproc.StartInfo.CreateNoWindow=true;
perlproc.EnableRaisingEvents=true;
perlproc.Exited +=new System.EventHandler (this.Process_Exited);
perlproc.StartInfo.UseShellExecute=false;
perlproc.StartInfo.RedirectStandardOutput=true;