摘要: C#.NET禁止一个程序启动多个实例Boolean createdNew; //返回是否赋予了使用线程的互斥体初始所属权System.Threading.Mutex instance = new System.Threading.Mutex(true, "MutexName", out createdNew); //同步基元变量if (createdNew) //赋予了线程初始所属权,也就是首次使用互斥体{ Application.Run(new Form1()); /s/这句是系统自动写的 instance.ReleaseMutex();}else{ MessageBox 阅读全文
posted @ 2013-12-17 17:27 marslin_1984 阅读(1747) 评论(0) 推荐(0)