using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; namespace 进程 { class Program { static void Main(string[] args) { //获得当前程序中所有正在运行的程序 Process[] pro = Process.GetProcesses(); foreach (var item in pro) { Console.WriteLine(item); } //通过进程打开应用程序 Process.Start("calc"); //打开计算器 Process.Start("mspaint"); //打开画图 Process.Start("iexplore","http://www.baidu.com"); //打开IE浏览器连接百度 //通过进程打开指定文件 ProcessStartInfo psi = new ProcessStartInfo(@"D:Notepad++ otepad++.exe"); //创建进程对象 Process p = new Process(); p.StartInfo = psi; p.Start(); Console.ReadKey(); } } }