I'm doing asp.net development. And I'm using C# to execute DOS commands(which the DOS command line execute some test application).
Once the user click the Execute Button(just a regular asp.net button, that the event invoke the execution of DOS command) at the asp.net page, the DOS command would be executed.
I would like to pass the output/debug messages or any messages output by the DOS command to the asp.net page so that user can see the progress and some information about the DOS command execution.
My DOS command is to call the source control(MKS) application to create a sandbox in my pc. I would like to pass the messages output by this command to the asp.net page. (When I execute this DOS command in DOS prompt it would output the error messages e.g pass, fail to create sandbox, and etc.)
Dumping the output to the label would work. But how to get the output/debug messages of the DOS exectution in C#.?
string mksCreateVariantSandboxCmdStr = @"si createsandbox -R --populate --project=" + getProjectNameStr() + @" --devpath=" + getVariantNameStr() + @" --status=default --yes " + getSandPathStr();
//Working example of executing dos command in C#
//create & mapping the variant sandbox
System.Diagnostics.Process processCrVarSandBox = new System.Diagnostics.Process();
processCrVarSandBox.EnableRaisingEvents = false;
System.Diagnostics.Process.Start("cmd.exe", @"/C " + mksCreateVariantSandboxCmdStr);