Click here to Skip to main content
15,922,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a java application. This application is running and writting the result in the console. I'm starting the application with java -jar application.jar

I want to use the lines in the console in a C# application. To do this :
C#
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;

p.StartInfo.FileName = "java.exe";
p.StartInfo.Arguments = " -jar application.jar";
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);      
p.Start();


My problem is that nothing append in the p_OutputDataReceived funtion.
How to do this ?

Sincerely,
Posted

1 solution

You need to call BeginOutputReadLine[^] to receive this event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900