// Call cmd for execution.
Private void process ()
{
PROCESS p = new process (); // load the CMD command line and pass the parameter execution
P. startinfo. filename = "cmd.exe"; // set the target to be called.ProgramOr file, filename attribute is not
P. startinfo. useshellexecute = false; // whether to start the process using the operating system shell program
P. startinfo. redirectstandardinput = true; // redirect standard input direction
P. startinfo. redirectstandardoutput = true; // redirect standard output direction
P. startinfo. redirectstandarderror = true; // whether to write process error output to
P. startinfo. createnowindow = false; // whether the CMD Command Prompt window is displayed
String stroutput = NULL; // receives the doscommand execution result
P. Start ();
P. standardinput. writeline (@ "cd d: \ projects \ COMIS \ cmp101 \ bin \"); // This is the doscommand to be executed
P. standardinput. writeline ("cmp101.exe 200805 ");
P. Dispose ();
}
// Directly execute
Private void process1 ()
{
System. Diagnostics. processstartinfo info = new system. Diagnostics. processstartinfo ();
Info. filename = "cmp101.exe"; // obtain or set the application or document to be started
Info. workingdirectory = "D:/projects/COMIS/cmp101/bin"; // gets or sets the initial directory of the process to be started.
Info. Arguments = "200805"; // gets or sets a set of command line parameters to be used when an application is started
Info. createnowindow = false; // obtain or set the value indicating whether to start the process in a new window
Info. verb = "open"; // get or set the predicate used to open the application or document specified by the filename attribute
Info. windowstyle = system. Diagnostics. processwindowstyle. Normal; // gets or sets the window status used when the process is started.
Info. useshellexecute = true; // gets or sets a value indicating whether to start the process using the operating system shell program
System. Diagnostics. process. Start (Info );
}
// Use the Stored Procedure Call of the database
Private void process3 ()
{
String SQL = "xp_mongoshell 'd:/projects/COMIS/cmp101/bin/cmp101.exe 200805 '";
}