I have a jar that, if I run from the command line, returns me true or false printed on the console
I am trying to run this from C # and get the result - this is done like this:
Process p = new Process(); p.StartInfo = new ProcessStartInfo("java", @"-jar test.jar " + paramterForStringArgs[0]); p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.Start(); String s = p.StandardOutput.ReadToEnd(); p.WaitForExit(); Trace.WriteLine("data = " + s); return false;
It seems I always get an empty string and wondered why this could be, or if there is a better way to do this?
source share