How can I check for multiple instances of my visual basic application? When the user runs the application, I want to know how many instances are already open. Thank you.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The “fastest” way would be use to the System.Diagnostics.Process class to find all instances of your specific process name if all you want to do is get the count of processes.
So, as an example to find instances of “Explorer” use this.
If you are looking to limit users to 1 instance, then I would look at creating a named Mutex and using that to prevent others from starting.