using
System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
namespace OneCase
... {
static class Program
...{
/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
...{
bool isNew;
Mutex m = new Mutex(true, "MyApp", out isNew);
if (isNew)
...{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else
...{
MessageBox.Show("已经存在一个程序实例!");
Application.Exit();
}
}
}
}
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
namespace OneCase
... {
static class Program
...{
/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
...{
bool isNew;
Mutex m = new Mutex(true, "MyApp", out isNew);
if (isNew)
...{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else
...{
MessageBox.Show("已经存在一个程序实例!");
Application.Exit();
}
}
}
}