bool owership = false;
Mutex mutex = new Mutex(true, "BSPrint_Only", out owership);
if (owership)
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.Run(new Form1());
}
finally
{
if (mutex != null)
{
mutex.Close();
}
}
}
else
{
MessageBox.Show("FDC客户端已经打开");
}
Mutex mutex = new Mutex(true, "BSPrint_Only", out owership);
if (owership)
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.Run(new Form1());
}
finally
{
if (mutex != null)
{
mutex.Close();
}
}
}
else
{
MessageBox.Show("FDC客户端已经打开");
}