>how can I run only two instance of my application through a lan network.
>any help thank you
There are mulitple ways to do this.
you may look in the UT searcher for previous threads about this.
What you can do is creating a table on the server with two records
when a app is started you can fill the first record, and place a timestamp in it. Now you must update that timestamp every minute or so.
When you close the app you can clear the timestamp
When another users starts the app, you look at the table and see the first record already filled in, so it looks at the second one. If that one is also full than the app can display a message like 'license limited to 2 simultanous users'.
The timestamp is needed for if the app crashes, or someone shutted down the computer or ....
If you see the timestamp is older then a a few minutes, then the app is not used.
Look out with the above when the computer clocks are not at the same time. then the app may think the timestamp is timed out. and also when a messagebox appears, an eventual timer will not work until the messagebox is released.
You cannot place record locks for doing this. It will work when the user shuts down normally, but will not when they terminate the app or the computer abnormally. then the lock will not be released until the server starts up again.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement