ASP.NET实现程序的互斥运行
实现程序的互斥运行
using System.Threading;
static void Main(){
bool createdNew;
Mutex m = new Mutex(true, "test", out createdNew);
if(createdNew){
application.Run(new Form1() );
m.ReleaseMutex();
}else{
MessageBox.Show("不能运行程序的多个实例");
}//end if
}//end Main()