Mutex

    [WPF] 단일 인스턴트 응용 프로그램

    이미 실행중인 프로그램일때 새로운 응용프로그램은 종료시켜보자. 위와 같이 처리 후 아래와 같이 Mutex를 이용하여 같은 응용프로그램이 있는지 체크하여 실행/종료 using System.Windows; using System.Threading; namespace WpfApplication2 { /// /// App.xaml에 대한 상호 작용 논리 /// public partial class App : Application { Mutex mutex; protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); string mutexName = "InstanceName"; bool createdNew; mutex = new Mutex(..