in my project (MVC 3) I want to run an external console application using the following code:
string returnvalue = string.Empty;
ProcessStartInfo info = new ProcessStartInfo("C:\\someapp.exe");
info.UseShellExecute = false;
info.Arguments = "some params";
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
info.CreateNoWindow = true;
using (Process process = Process.Start(info))
{
StreamReader sr = process.StandardOutput;
returnvalue = sr.ReadToEnd();
}
but I get an empty string in the returnvalue
and that program creates a file as a result but there is not any file created. Maybe taht Process
is not being executed ?