PC Review


Reply
Thread Tools Rate Thread

how to allow only one instance of an application?

 
 
assaf
Guest
Posts: n/a
 
      26th Nov 2004
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



 
Reply With Quote
 
 
 
 
CiccioPalla
Guest
Posts: n/a
 
      26th Nov 2004
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...)


"assaf" <(E-Mail Removed)> ha scritto nel messaggio
news:urm5#(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      26th Nov 2004
assaf <(E-Mail Removed)> wrote:
> 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?


See http://www.pobox.com/~skeet/csharp/f...ation.instance

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
One Instance of two application LirenZhao Microsoft Dot NET Compact Framework 5 8th Jul 2005 08:47 AM
Application Instance T Cordon Microsoft Dot NET Framework Forms 1 8th Jul 2004 06:50 PM
Multi-instance vs single instance application kathy Microsoft C# .NET 3 8th Jan 2004 12:53 AM
How can mimed Application files open in existing application instance? TomShelley Microsoft Dot NET Framework Forms 1 13th Nov 2003 03:13 AM
Re: Run only 1 instance of the application Dennis Peterson Microsoft Dot NET Framework Forms 0 12th Aug 2003 08:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:27 PM.