I'm sorry about my title may be it make you confusing (it's just I don't know what words should I use). My problem is I don't want to allow user to open my application multiple time. Please help. Thank you in advance.
One of the most common reasons to limit the number of instances is to restrict the access to some sensitive resources. For this purpose, we use the Mutex object. This approach can be used on all three types of desktop applications (console, winforms, WPF).
A Single Instance application is an application that limits the program to run only one instance at a time. This means that you cannot open the same program twice.
Disable multiple instances of app. In order to disable multiple instances of an app on Windows 10, you need to install a free app called SingleInstance. Go ahead and download, and run the app. The app, by default, has one app pre-configured and that's the Calculator app on Windows 10.
Just go to the project properties and click the "Single Instance Application" checkbox.
Use the “Make single instance application” flag; in the solution explorer, right-click the project and select properties. See this question for more details.
MSDN documentation here.
Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With