📜  c# 如何启动应用程序并检测是否已启动 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:40.934000             🧑  作者: Mango

代码示例1
using System.Diagnostics;
using System.IO;
using System.Reflection.Assembly;

class Class
{
    if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(GetEntryAssembly().Location)).Count() > 1) 
    {
        Process.GetCurrentProcess().Kill();
    }
 
}