Start application just one time C#

This question already has an answer here:

  • What is the correct way to create a single-instance application? 35 answers

  • Please check this question: Run single instance of an application using Mutex

    You are looking for Mutex to check if you application is running. Then find your running application Process and bring it forward.


    The way I have achieved this is to use a Mutex . Each instance of the application tries to lock the mutex at startup. If they succeed, they get to run; if they fail, they don't.

    The application that doesn't get to run also restores and activates the running instance. This is achieved differently depending on whether it's a WPF or WinForms application.

    The advantage to the mutex approach is that it is less prone to race conditions than using FindWindow.


    when your application start you have to see the processes that your instance of application is already running or not then make decision according to it.

    Possible duplicates :

    Detecting a Process is already running in windows using C# .net

    How to check already running exe in c#.net?

    链接地址: http://www.djcxy.com/p/51144.html

    上一篇: 在.net中制作单实例应用程序的最佳方法是什么?

    下一篇: 只启动一次应用程序C#