|
|
|
@ -12,6 +12,7 @@ using SlnMesnac.Extensions;
|
|
|
|
|
using SlnMesnac.Generate;
|
|
|
|
|
using SlnMesnac.TouchSocket;
|
|
|
|
|
using SlnMesnac.Redis;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
@ -42,12 +43,22 @@ namespace PrintBarCode
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class Startup
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private System.Threading.Mutex? mutex = null;
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="configuration"></param>
|
|
|
|
|
public Startup(IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
bool ret;
|
|
|
|
|
mutex = new System.Threading.Mutex(true, System.Diagnostics.Process.GetCurrentProcess().ProcessName, out ret);
|
|
|
|
|
if (!ret)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("应用程序已开启,禁止重复运行");
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Configuration = configuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|