Private void mybutton2_click (Object sender, eventargs e) <br/>{< br/> // execute ("Net user zero 0571m.com/Add", 0 ); <br/> string output = execute ("Ver" + "/R/N", 0); <br/> console. writeline (output); <br/>}< br/> Public static string execute (string doscommand, int outtime) <br/>{< br/> string output = ""; <br/> If (doscommand! = NULL & doscommand! = "") <Br/>{< br/> Process = new process (); // create a process object <br/> processstartinfo startinfo = new processstartinfo (); // a set of values used when creating a process, as shown in the following attributes <br/> startinfo. filename = "cmd.exe "; // set the command <SPAN class = 'wp _ keywordlink '> Program </span> <br/> // The following method is used to hide the CMD window <br/> startinfo. arguments = "/C" + doscommand; // set the parameter. To enter the character of the command program, "/C" indicates that the command is exited immediately after execution. <br/> startinfo. useshellexecute = false; // do not use the System Shell to start <br/> startinf O. redirectstandardinput = false; // do not redirect the input <br/> startinfo. redirectstandardoutput = true; // The redirected output is not displayed on the DOS console by default. <br/> startinfo. createnowindow = true; // do not create a window <br/> process. startinfo = startinfo; </P> <p> try <br/> {<br/> If (process. start () // start the process <br/>{< br/> If (outtime = 0) <br/> {process. waitforexit () ;}< br/> else <br/> {process. waitforexit (outtime) ;}< br/> output = process. standardoutput. Readtoend (); // read process output <br/>}< br/> catch <br/>{</P> <p >}< br/> finally <BR/>{< br/> If (process! = NULL) <br/> {process. Close () ;}</P> <p >}< br/> return output; <br/>}