Files
SCRGroupLine/GroupLine.App/App.xaml.cs
2026-03-16 10:36:47 +08:00

26 lines
637 B
C#

using System.Windows;
namespace GroupLine.App
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
private static System.Threading.Mutex mutex;
protected override void OnStartup(StartupEventArgs e)
{
mutex = new System.Threading.Mutex(true, "OnlyRun_CRNS");
if (mutex.WaitOne(0, false))
{
base.OnStartup(e);
}
else
{
MessageBox.Show("程序已经在运行!", "提示");
this.Shutdown();
}
}
}
}