programming/.net

csharp 프로그램이 하나만 실행되게 하는 방법

happy4u 2005. 12. 2. 01:39

주위에 물어보는 사람이 있어 찾아봤는데.. 간단하네요..
bool firstInstance;

Mutex mutex = new Mutex(false, "Local\\"+someUniqueName, out firstInstance);

// If firstInstance is now true, we're the first instance of the application;

// otherwise another instance is running.
 
출처 : http://www.yoda.arachsys.com/csharp/faq/#one.application.instance
 
위 방법을 이용한 예제 소스
출처 : http://www.codeproject.com/csharp/cssingprocess.asp