进程Process
通过进程打开一个应用程序或文件
调用命名空间:
using System.Diagnostics;
Process.Start("calc");
线程类:
using System.Threading;
Thread thread1; private void button1_Click(object sender, EventArgs e) { Control.CheckForIllegalCrossThreadCalls = false; thread1 = new Thread(Thread1_Method); thread1.IsBackground = true; thread1.Start(); } private void Thread1_Method() { int i = 0; while (true) { textBox1.Text = i.ToString(); i++; } } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { thread1.Abort(); }