how to allow only one instance of an application?

A

assaf

hi all

i want to block my users
from running more then
one instance of my app
on their machine.

how can i block my users from running more
then one instance of my app on their machines?


assaf
 
C

CiccioPalla

bool isFirstInstance = true;

Mutex mutex = new Mutex(true ,"INSTANCECHECK", out isFirstInstance );

if (!isFirstInstance)
{
MessageBox.Show("Another instance is running");
//...
}
//...

(you can change "INSTANCECHECK" to what you want...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top