I would like to execute a program in .NET server side code.
So far I have this:
Process p = new Process();
p.StartInfo.FileName = "myProgram.exe";
p.StartInfo.Arguments = " < parameter list here > ";
p.Start();
p.Close();
This is a console program. What happens is that console is opened and closed repeatedly without stopping.
You want,
what happens in your code is you start the process and you close it right away,
what you need is call WaitForExit() which actually waits for the process to close on its own,
To Print the output before the app closes: