📅  最后修改于: 2022-03-11 14:48:40.934000             🧑  作者: Mango
using System.Diagnostics;
using System.IO;
using System.Reflection.Assembly;
class Class
{
if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(GetEntryAssembly().Location)).Count() > 1)
{
Process.GetCurrentProcess().Kill();
}
}