您的位置:首页 > 其它

实现程序的互斥运行

2005-12-13 17:13 155 查看
实现程序的互斥运行
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()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: