// It seems very simple .. A program is an interface. A prompt on the left shows a checkbox prompting the user "I know, please do not display it again". A button running QQ is displayed on the right. But it took about four hours. Debugging is often correct, but sometimes it is not reflected after the button is clicked,
// The external program cannot be run. // The Events () method is better, but this may happen occasionally. System. Threading. Thread. Sleep (2000); solved .. There is no turning.
Public static void RunQQ ()
{
// An example is a Process type, which initiates a pipeline.
Process p = new Process ();
String command = @ "d: \ sysset \ menu \ runqq. bat ";
// The Process class has a StartInfo atomicity. This is ProcessStartInfo class, which includes some attention and methods. We will use its attention below:
P. StartInfo. FileName = command; // set the program name
P. StartInfo. Arguments = "/c" + string. Empty; // you can specify the number of rows in the program.
P. StartInfo. UseShellExecute = false; // use of related Shell
P. StartInfo. RedirectStandardInput = true; // redirect the standard ingress
P. StartInfo. RedirectStandardOutput = true; // redirect the mark to export
P. StartInfo. RedirectStandardError = true; // redirect zookeeper output
P. StartInfo. CreateNoWindow = true; // you can specify a non-empty window.
P. Start (); // dynamic
// P. StandardInput. WriteLine (command); // you can also use this method to export the command to be executed.
// P. StandardInput. WriteLine ("exit"); // you must remember to add Exit. Otherwise, the next line of program will become available.
}
// It is very important .. Is used
Application. DoEvents (); System. Threading. Thread. Sleep (2000); Directory. CreateDirectory (@ "e: \ OK"); // create a folder
If (! Directory. Exists (@ "e: \ OK") // create a folder if the folder does not exist
{
// Display the form.
Application. Run (new Form1 ());
}