singleton

  • Thread starter Thread starter Nick C
  • Start date Start date
N

Nick C

Hi

I would like to implement a singleton in vb.net. The application only can be
run by one user at the time. Does anyone have any articles/samples that can
help me with this problem? thanks

N
 
Hi

I would like to implement a singleton in vb.net. The application only
can be run by one user at the time. Does anyone have any
articles/samples that can help me with this problem? thanks

Are you using VS.NET 2005? VS.NET 2005 Windows Form projects have the
ability to specify single instance or not.


Either way, take a look at using a Mutex. A mutex is a system wide
synchronization object - thus you can use it to check if there is a prior
instance of the object running.
 
This of course depends on whether the application accesses resources outside
the scope of your PC, or makes resources available to other
machines on the network or via. remoting. Its simple to make the
application itself "single instance" (i.e. one instance running on one PC),
simply in your project properties -> application -> single instance.
However if you want to block other machines from running at the same time,
you will need some kind of license management. This is my easily achieved
in my view by using hardware dongles.
 
Nick,

You got your answer from Duracel, however try to ask in your subjects what
you mean, what you ask is not a singleton.

Cor
 
Back
Top