string moduleName = Process.GetCurrentProcess().MainModule.ModuleName;
string prcessName = System.IO.Path.GetFileNameWithoutExtension(moduleName);
Process[] processes = Process.GetProcessesByName(prcessName);
if (processes.Length>1)
{
    MessageBox.Show("程序已经运行!");
    Process.GetCurrentProcess().Kill();
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2022-02-18
  • 2021-12-26
猜你喜欢
  • 2022-01-11
  • 2021-10-01
  • 2021-10-28
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案