//声明互斥体Mutex mutex = new Mutex(false, "ThisShouldOnlyRunOnce");//判断互斥体是否使用中bool Running = !mutex.WaitOne(0, false);if (!Running) Application.Run(new Form1());else MessageBox.Show("应用程序已经启动!");
版权声明:本文为博主原创文章,未经博主允许不得转载。
本文共 325 字,大约阅读时间需要 1 分钟。
//声明互斥体Mutex mutex = new Mutex(false, "ThisShouldOnlyRunOnce");//判断互斥体是否使用中bool Running = !mutex.WaitOne(0, false);if (!Running) Application.Run(new Form1());else MessageBox.Show("应用程序已经启动!");
版权声明:本文为博主原创文章,未经博主允许不得转载。
转载于:https://www.cnblogs.com/GuZhenYin/p/4663047.html