2017-5-4 process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.