-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
33 lines (32 loc) · 1002 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UChat
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
//使程序只能运行一个实例。
bool isAppRunning = false;
System.Threading.Mutex mutex = new System.Threading.Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out isAppRunning);
if (!isAppRunning)
{
//MessageBox.Show ( "本程序已经在运行了,请不要重复运行!" );
Environment.Exit(1);
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormBackground());
}
}
}
}