使用互斥体Mutex类型

using System.Threading;

//声明互斥体
Mutex mutex = new Mutex(false, "ThisShouldOnlyRunOnce");
//判断互斥体是否使用中
bool Running = !mutex.WaitOne(0, false);
if (!Running)
     Application.Run(new Form1());
else
      MessageBox.Show("应用程序已经启动!");

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-12-05
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
  • 2022-02-01
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案