Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Users In The System. How to do it.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00332775
Message ID:
00333016
Vues:
17
>HI!
>
>I have a function called users in system:
>What it currently does is:
>on the server I have a PROFILES folder
>PROFILES -
> USER1
> foxuser.dbf
> USER2
> foxuser.dbf
>
>The program checks all user folders and tries to open the foxuser.dbf excl
>If it fails then the user is assumed to be in the system.
>
>This solution usually works but often it shows some users which left the system
>I think NT holds the files as a part of it's file caching therefor the excl call fails.
>It seems this way because you also cannot delete the file at this time.
>
>Also it sometimes fails to pick up some users (I dopn't know why)
>
>What I am looking for is ideas on how to show the users that are in the system...
>I used to have a login table with a record for each logged in user but when the program crashes
>this record is not deleted and it appears there are users in the system.
>
>What do you people use if anything for this type of function?!?!?

My app got so big that I had to break it into 12 smaller exe's. To keep
track of who was running what I created a table with the login id's of all
my users and with logical fields of the names of my apps. When a user runs
and executable the main.prg has a function which does the following:

PROCEDURE SetAppMon
PARAMETERS TheState
USE (cDefaultDir +"\DATA\AppMon") IN 0 ALIAS AppMon SHARED
LOCATE FOR ALLTRIM(REVID) == gcNameX
IF FOUND() AND NOT EOF()
REPLACE F50 WITH TheState
ENDIF
USE
ENDPROC

In this case the F50 app has it's logical state set according to ThState,
be that .T. when logging on or .F. when loging off...
*
DO SetAppMon WITH .T.
*
DO form50.mpr
READ EVENTS
*
DO SetAppMon WITH .F.

If WinXX crashes or the user shutdown the workstation without logging off then
the state won't be turned off. I can watch this and respond accordingly if a
person is abusing operating rules or if their WinXX has become too unstable.
JLK
Nebraska Dept of Revenue
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform