Process:
An application is a process
Open a process
Process.Start ("Abbreviated file name");
Open a process with an absolute path
Process P = new process ();
P.startinfo = new ProcessStartInfo ("Absolute path to open program");
P.start ();
Get all the open processes:
Process.getprocesses ();
Kill process
Object. Kill ();
Commonly used to open a Web page registration account:
Process.Start ("http://...");
For example:
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Diagnostics;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespacewindowsformsapplication7{ Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); } Private voidButton1_Click (Objectsender, EventArgs e) { //Process.Start ("Calc"); //Process.Start ("notepad"); //Process.Start ("Chrome");Process Pro =NewProcess (); ProcessStartInfo PSI=NewProcessStartInfo (TextBox1.Text); Pro. StartInfo=psi; Pro. Start (); } Private voidButton2_Click (Objectsender, EventArgs e) {Openfiledialog1.filter="Application |*.exe"; DialogResult Dr=Openfiledialog1.showdialog (); if(dr==DialogResult.OK) {TextBox1.Text=Openfiledialog1.filename; } } Private voidButton3_Click (Objectsender, EventArgs e) { } Private voidLinklabel1_linkclicked (Objectsender, LinkLabelLinkClickedEventArgs e) {Process.Start ("http://www.qq.com"); } Private voidButton3_click_1 (Objectsender, EventArgs e) {process[] proc=process.getprocesses (); foreach(Process Pinchproc) { //P.kill ();richTextBox1.Text + = p.tostring () +"/ R"; } } }}
2017-5-4 process