#region 防止重复启动
Process[] allAPP = Process.GetProcesses();
int j = 0;
foreach (var APP in allAPP)
{
if (APP.ProcessName == "自动化控制系统")
{
j++;
if (j > 1)
{
MessageBox.Show("此程序运行中,请勿重复启动!");
return;
}
}
}
#endregion
防止软件重复启动的代码
最新推荐文章于 2023-02-28 23:13:08 发布