1. Process的Start()静态方法
using System.Diagnostics;
Process p = Process.Start(@"C:\\WINDOWS\\desktop.ini");
2.StartInfo
即:如何启动与某一给定文档扩展名或文件类型关联的应用程序而又无须知道该关联应用程序的名称或位置。
Process 类的 ProcessStartInfo 结构来指定启动进程时的选项。
成员 UseShellExecute 指定基于文件扩展名或文件类型而非基于可执行文件 (.exe) 的名称来启动进程。此属性默认设置为 true。
//获取系统路径,要启动的文件路径
string sysFolder = Environment.GetFolderPath(Environment.SpecialFolder.System);
//Create a new ProcessStartInfo structure.
ProcessStartInfo pInfo = new ProcessStartInfo();
//Set the file name member.
pInfo.FileName = sysFolder + @"\eula.txt";
//UseShellExecute is true by default. It is set here for illustration.
pInfo.UseShellExecute = true;
Process p = Process.Start(pInfo);
*****************************************************************************************************
引用:System.Diagnostics.Process
// using System.Diagnostics;
private string appName = "calc.exe";
/// <summary>
/// 1. 启动外部程序,不等待其退出
/// </summary>
private void button1_Click(object sender, EventArgs e)
{