You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CaiQie/RfidWeb/Program.cs

38 lines
1.2 KiB
C#

3 months ago
using System;
2 weeks ago
using System.Diagnostics;
3 months ago
using System.Windows.Forms;
namespace RfidWeb
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
2 weeks ago
// 获取当前运行的进程名
string currentProcessName = Process.GetCurrentProcess().ProcessName;
// 检查是否存在其他同名进程
var processes = Process.GetProcessesByName(currentProcessName);
if (processes.Length > 1)
{
// 如果有多个同名进程,说明已经有实例在运行
MessageBox.Show("应用程序已在运行!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
2 months ago
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
3 months ago
Application.EnableVisualStyles();
1 month ago
Application.SetCompatibleTextRenderingDefault(false);
2 weeks ago
Application.Run(new FormMain());
2 weeks ago
//Application.Run(new FromSQl());
3 months ago
}
}
}