Process:
You first need to reference the namespace:
Using Systemdiagnostics;
The simplest way to open a process, the process name is not kanji:
Process.Start ("calc"); // CLAC is the calculator process, you can use this method to open the calculator Process.Start ("notepad"); // multiple processes can be opened at the same time, Notepad is Notepad
To open a process in a browse way:
//first, the path of a process is output to a textbox;//returns a bool typeDialogResult dr =Openfiledialog1.showdialog ();//Judgingif(Dr==diagloresult.ok) {TextBox1.Text=Openfiledialog.filename}//After you export the file path to a text box, open the path in the text box directlyProcess p =NewProcess;//start processing This information in a textboxProcessStartInfo psi =NewProcessStartInfo (TextBox1.Text);p. StartInfo=Psi;p.start ();
You can use Process.Start ("Chrome", "http://www.baidu.com") if you output a process with a specified browser.
The default browser direct output can be Process.Start ("http://www.baidu.com");
Multithreading:
Using System.Threading;
Thread.Sleep ();
A thread can only do one thing at a time;
Create a new thread (foreground thread):
The main thread has stopped, and the background threads continue to
// delegate's keyword Delegate New Thread (need to write a delegate, the delegate is pointing to a method, the delegate does not need to write parentheses, only need to write the method name); // When the thread is finished, it is deleted, and the new thread is re-added the next time the method is executed .
Background thread:
The main thread stops the background threads immediately;
New // Creating Objects true // setting up a background thread // Start Execution
"Off-Monitor" method:
false;
C # Winfrom Process & Multithreading