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

39 lines
1.2 KiB
C#

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