日期:2014-05-17 浏览次数:20928 次
// 进程互斥
private System.Threading.Mutex myMutex = null;
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// 禁止同时打开2个
bool mutexIsNew = false;
try
{
myMutex = new System.Threading.Mutex(true, configs.ID, out mutexIsNew);
}
catch { }
if (!mutexIsNew)
{
if (configs.logsEnable) { launchLog.addLog(@"主程序多次打开,不重复启动。"); }
this.Close();
}