Information générale
Catégorie:
Codage, syntaxe et commandes
>>Hi everyone,
>>
>>I want to restrict the number of users who can work on my multiuser VFP 5.0 executable simultaneously to a set number, for licensing purposes.
>>
>>One of the ways I've done that in the past is to use a password table and lock the record for the logged on user in that password table. My worry with this is that when a workstation crashes, the lock may not be released, leaving the user locked out.
>>
>>Does anyone have any ideas on the best way to achieve what I want to do? Thanks very much. Rene.
>
>Rene,
>I did something similar to this some years ago using C whereas my application contained some 'dummy' data which was then stored in the .exe file. My application then used this area in the exe to keep a log of users. Each time a user ran the app, every few seconds the app would place the time into this area in the exe - when another user comes along, the slots are checked for open spaces and, if none found, would check to see if any have an out-of-date time slot and use one up if it finds it. I think that this idea could be modified to work with VFP in some way.
Unless you have a static list of users, the locking of records in a shared table precludes the dynamic addition of new users. Suggest you consider external semaphore file named for the user, opened exclusively -- may be a table or low-level I/O file. Login checks for count of tables, erases those it can, and then checks for count of those left. Hope this helps.
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