1
/// <summary>
2
/// 应用程序的主入口点。
3
/// </summary>
4
[STAThread]
5
static void Main()
6
{
7
//当<=1时 只能打开一个实例
8
if (System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length <= 1)
9
{
10
Application.EnableVisualStyles();
11
Application.SetCompatibleTextRenderingDefault(false);
12
Application.Run(new F_Main());
13
}
14
else
15
{
16
MessageBox.Show("程序已经打开!");
17
}
18
}
/// <summary>2
/// 应用程序的主入口点。3
/// </summary>4
[STAThread]5
static void Main() 6
{7
//当<=1时 只能打开一个实例8
if (System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length <= 1)9
{10
Application.EnableVisualStyles();11
Application.SetCompatibleTextRenderingDefault(false);12
Application.Run(new F_Main());13
}14
else15
{16
MessageBox.Show("程序已经打开!");17
}18
}


浙公网安备 33010602011771号