摘要:
Process[] p = Process.GetProcesses(); int processCount = 0; foreach (Process p1 in p) { if (p1.ProcessName.Trim() == "程序名") { processCount = processCount + 1; } } if (processCount > 1) { MessageBox.Show("程序已启动"); Application.Exit(); return; } 阅读全文