Run java program on c# .Net using cmd.

AnkiIt_wizard5 66 Reputation points
2021-02-18T05:16:50.33+00:00

I have successfully executed a Java Program using the System.Diagonists.Process method in C# using. But i want to give input for program? How i do this?help me

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 111.8K Reputation points
    2021-02-18T06:37:01.387+00:00

    If your program accepts command-line arguments, then you can use the second parameter of Process.Start, or the Arguments property of ProcessStartInfo, to pass the data to your Java program. (For example, I case of javac program, you can execute “javac MyProgram.java”; here MyProgram.java is the argument). If the Java program is made by you, then adjust it to accept arguments.