Hello all,
I have a web application which needs to call a console application and capture the output of that execution process.
What I have is the following:
The problem I have is that no matter which option I set (CreateNoWindow , UseShellExecute ..etc), the console application will always pop up when this web page executes. What have I missed ?
However, I have tried to use the same code on a standalone windows app and it's working as expected. Just that when I run this code on a webpage, it just doesn't do what I expected.
Thanks !!
I have a web application which needs to call a console application and capture the output of that execution process.
What I have is the following:
Code:
ProcessStartInfo psi = new ProcessStartInfo(); psi.WindowStyle = ProcessWindowStyle.Hidden; psi.FileName = "doTask.exe"; psi.Arguments = "abc"; psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.RedirectStandardOutput = true; Process proc = new Process() proc.StartInfo = psi; proc.Start(); string output = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); // print the output from this execution process on a web page.. etc
However, I have tried to use the same code on a standalone windows app and it's working as expected. Just that when I run this code on a webpage, it just doesn't do what I expected.
Thanks !!
Comment