how to capture java output from cammand line agrument using c#
capture output from cammad line argument
Collapse
This topic is closed.
X
X
-
lkrTags: None -
Jon Skeet [C# MVP]
Re: capture output from cammad line argument
lkr <lkr@discussion s.microsoft.com > wrote:[color=blue]
> how to capture java output from cammand line agrument using c#[/color]
Could you explain in a bit more detail? It's not obvious what you mean.
--
Jon Skeet - <skeet@pobox.co m>
Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.
If replying to the group, please do not mail me too
-
lkr
Re: capture output from cammad line argument
hi Jon
v r doing a editor in C# for compilation of c c++ and java.Simply open the
file and execute it...
here is the code
//////////////////////////starting the execution
here//////////////////////////
private void Execute_Click(o bject sender, System.EventArg s e)
{
try
{
Process chk = new Process();
string str_txtbx= txtbxCmd.Text;//compilation command
string str_txtbx1= txtbxPath.Text;//Path of the file to be
executed
if(str_txtbx1== "")
chk.StartInfo.F ileName=str_txt bx;
else
{
chk.StartInfo.A rguments=str_tx tbx1 ;
chk.StartInfo.F ileName=str_txt bx;
}
MessageBox.Show ("ERR TRy->"+ str_txtbx1 );
chk.StartInfo.U seShellExecute = false;
chk.StartInfo.R edirectStandard Output = true;
chk.Start();
chk.WaitForExit ();
string output = chk.StandardOut put.ReadToEnd() ;
MessageBox.Show (output);//
}
catch (Exception e1)
{
MessageBox.Show ("ERR ->" + e1.ToString());
}
}
//////////////end///////////////////////////////////////
But here from StandardOutput Stream we r not able to read.But process is
executing fine.
Actually after the execution the output of the program v have to display in
the form. How can this possible?
Expecting ur reply.......... ...
lkr
Comment
Comment