using SA_LTT;
|
using System;
|
using System.Threading;
|
using System.Windows.Forms;
|
|
namespace SA_LTT_UI
|
{
|
static class Program
|
{
|
/// <summary>
|
/// The main entry point for the application.
|
/// </summary>
|
|
private static Mutex _mutexObject;
|
private static string _strAppConstName = "SALTT-01";
|
|
[STAThread]
|
static void Main()
|
{
|
OperatingSystem os = Environment.OSVersion;
|
if ((os.Platform == PlatformID.Win32NT) && (os.Version.Major >= 5))
|
{
|
_strAppConstName = @"Global\" + _strAppConstName;
|
|
try
|
{
|
// 뮤텍스를 생성
|
_mutexObject = new Mutex(false, _strAppConstName);
|
}
|
catch (ApplicationException ex)
|
{
|
EquipmentLogManager.Instance.WriteExceptionLog(ex.StackTrace + "\r\n" + ex.Message);
|
return;
|
}
|
|
if (_mutexObject.WaitOne(100, false))
|
{
|
try
|
{
|
Application.EnableVisualStyles();
|
Application.SetCompatibleTextRenderingDefault(false);
|
Application.Run(new MainFrame());
|
|
_mutexObject.ReleaseMutex();
|
}
|
catch (ApplicationException ex)
|
{
|
EquipmentLogManager.Instance.WriteExceptionLog(ex.StackTrace + "\r\n" + ex.Message);
|
return;
|
}
|
}
|
else
|
{
|
MessageBox.Show(@"이미 실행되고 있습니다.", @"다중실행방지");
|
}
|
_mutexObject.Close();
|
}
|
}
|
}
|
}
|