首先引用命名空间:using System.Diagnostics;
在开始按钮的单击事件中写下如下代码:
try
{
Process process = new Process();
process.StartInfo.FileName = this.textBox1.Text;//软件的路径
process.Start();
this.textBox2.Text = process.ProcessName;//获取进程名称
}
catch (Exception ex)
{
}