Hi, Use the following code to run .jar file from c# private int ExecuteProcess(string cmd, string cmdParams, string workingDirectory, int timeout, out string stdOutput) { using (Process process = Process.Start(new ProcessStartInfo(cmd, cmdParams))) { process.StartInfo.WorkingDirectory = workingDirectory; //process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardInput = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.Start(); stdOutput = process.StandardOutput.ReadToEnd(); process.WaitForExit(timeout); return process.ExitCode; } } string stdOutput; string parameters = "Prajwal"; int exitCode = ExecuteProcess(@"C:\Program Files\Java\jre1.6.0\bin\Java.exe", " -jar samplejarfilename.jar " + parameters ,path, 5000, out stdOutput );
A
A P Prajwal
@A P Prajwal
Posts
-
How to execute .jar file in c# -
RAS connection using GSM - GPRS Modem [modified]Could you please provide the code to set the unimodem dial up connection properties on Win ce 5 using c#... I need to set programatically baud rate, stop bit, flow control, extra dial up string etc., Thanks in advance... my mail id is prajwal_ap@yahoo.co.uk