Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which users are running program
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01537149
Message ID:
01537422
Views:
61
>>>Dear all,
>>>What is the best way to know which users is running the program?
>>>I have a MyApp.exe that is in MyApp ( a shared folder ) on my server. I have 20 users that i want to know which user run the program and each user must can only run the program once.
>>>Thanks
>>
>>Create a users table that has one record for each user, when a user logs in lock their record, when they log out unlock it. The security system checks for locks in the user table to see which users are logged in. Log in first checks to see if the current user's record is locked, if it is refuse to allow log in. You can also have fields in the users table to track date and time of last login if you like. If you need more details use a child to the user table to track login and logout but use the active lock as the indicator that the user is still in the app.
>
>How do you handle users who exit the application other than through the prescribed logout? (turning off their machine, power outage, etc.)

Any abnormal termination of the program will clear the locks, thus you know it's been released, you might loose extra information, for example the logout time if you are tracking it. We've been using this mechanisms for years, since the DOS times, for we run several "Data Loggers" which we want to run only one instance system-wide, so if someone tries to run a second instance of the program, in the same machine or in any other networked machine, it will refuse to start.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform