防止应用程序多次执行(在进程里只一个)

[STAThread]
  static void Main()
  {
   bool isCreate;   
   Mutex mutex=new Mutex(true,"JNR3Lead",out isCreate);
   if(isCreate)
   {
    Application.Run(new Form1());
    mutex.ReleaseMutex();
   }
  } 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章