One of the simplest ways, and one which we use, is to create a text file upon startup based on the user's login name (eg "LIAM.USR"). This also allows you to prevent multiple logins using that username (by checking for the existence of that file). The file remains open until the application is closed.
At any point you can scan the directory where these files are created and get a list of the users currently using the application. One advantage of this method over simply inserting the user name into a table on entry and deleting it on exit is that if the application crashes (which is
never a coding issue *g*) for whatever reason, the
true list of logged in users are the files that are in the directory after a scan of the directory (which includes an attempt to delete each USR file).
The date and time stamp on the file will tell you how long the user has been logged in.
HTH
Liam
>I try to find how to control user licences for my application.
>I need to know how many user are using the application in a multiuser environment and take control over end user licences.
>Does anybody know how to implement this funcionality ?
Liam O'Hagan
MCP VFP Desktop Apps