string serverSoftwarePath = "Qi/ServerSoftWare";
string[] serverPaths;//所有软件的路径
List<Process> allOpenProcess = new List<Process>();
void Start()
{
serverPaths = Directory.GetFiles(serverSoftwarePath, "*", SearchOption.AllDirectories);
}
void OpenSoftware()
{
foreach (var item in serverPaths)
{
allOpenProcess.Add(Process.Start(item));
}
}
void CloseSoftware()
{
foreach (var item in allOpenProcess)
{
if (item != null && !item.HasExited)
{
item.Kill();
}
}
allOpenProcess.Clear();
}
unity C# windows启动/关闭exe程序
最新推荐文章于 2025-02-26 16:04:19 发布