I have a problem with my newly application where i want to execute a c/java program file. And after executing the file i want to work with the output of that file. Please anybody give me the solution for that how can i do this?

Re: Need a C# application that execute the C/Java program file and give output 80 80

To launch the c/java from c#, assuming is an exe file, or the file extension has a 'open with' configured on your system, you can use some thing like

var fileToLaunch = "SomeFilePathHere";
var process = new Process();
process.StartInfo = new ProcessStartInfo()
    UseShellExecute = true,
    FileName = fileToOpen


then to open the resulting file, you can use a stream reader like:

StreamReader streamReader = new StreamReader(resultingFilePath);
string text = streamReader.ReadToEnd();

You shall need project references for the System.Diagnostics and The System.IO namespaces

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.