// 실행파일 한번만 실행시키는 방법: mutex 사용

 

static void Main()

{

bool checkOther = false;

try

{

m_OneProcess = new System.Threading.Mutex (true, "App", out checkOther);

 

if (false == checkOther)

{

return ;

}

Application.Run(new Form1());

 

 

}

catch

{

}

finally

{

if (null != m_OneProcess && false != checkOther)

{

m_OneProcess.ReleaseMutex ();

}

}

}

 

 

'프로그래밍 > .Net' 카테고리의 다른 글

C# 메모리 관리 - 마소 발췌  (0) 2014.01.17
Drag & Drop 기능 구현하기  (0) 2014.01.17
String.Format으로 할 수 있는 일들  (0) 2014.01.17
Tick Count 가져오기  (0) 2014.01.17
WaitHandles 사용  (0) 2014.01.17

+ Recent posts