..
This commit is contained in:
@@ -18,18 +18,13 @@ namespace Project
|
||||
static void Main()
|
||||
{
|
||||
//중복실행방지
|
||||
var guidAttr = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), true);
|
||||
if (guidAttr != null)
|
||||
string mutexName = "AGV4_Application_Mutex";
|
||||
Mutex mtx = new Mutex(true, mutexName);
|
||||
var success = mtx.WaitOne(new TimeSpan(0, 0, 1));
|
||||
if (success == false)
|
||||
{
|
||||
var guida = (GuidAttribute)guidAttr[0];
|
||||
var guidstr = guida.Value;
|
||||
Mutex mtx = new Mutex(true, guidstr);
|
||||
var success = mtx.WaitOne(new TimeSpan(0, 0, 1));
|
||||
if (success == false)
|
||||
{
|
||||
MessageBox.Show("중복실행 불가\n\n프로그램이 실행 중 입니다");
|
||||
return;
|
||||
}
|
||||
MessageBox.Show("Duplicate execution not allowed\n\nProgram is already running");
|
||||
return;
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
|
||||
Reference in New Issue
Block a user