using System;
using System.Diagnostics;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
try
{
// 要打开的软件的路径
string softwarePath_idea = "";
string softwarePath_vscode = "";
string softwarePath_vm = "";
string softwarePath_db = ""
// 启动进程并获取对应的 Process 对象
Process process = Process.Start(softwarePath_idea);
process = Process.Start(softwarePath_vscode);
process = Process.Start(softwarePath_vm);
process = Process.Start(softwarePath_db);
// 在这里可以执行其他的操作...
// 等待进程结束
process.WaitForExit();
process.Kill();
}
catch (Exception ex)
{
Console.WriteLine("打开软件时出现错误: " + ex.Message);
}
}
}
}
由于不知道怎么杀掉当前进程,所以可能要手动删掉下
标签:尝试,Process,string,Start,windows,softwarePath,process,应用程序,打开 From: https://www.cnblogs.com/HelloWorlddd/p/17536423.html