>Hello,
>
>At any given time, I need to know how many users have logged in to the system.
>
>I got an exe which everybody executes to run the system over the network. To check how many people are accessing the system, I think checking how many people are accessing this exe will do.
>
>Is there any Windows API that could use for this purpose.
>
>I do not like to do a manual operation by monitoring the logins or logouts.
>
>Any help would be much appreciated.
>
>Regards,
>Deva
What I did is to record both login and logout into separate records, adding a record every time. The analysis of this log, for the time being, is very manual - but I hardly need it any more.
Yes, you said you didn't want to do it this way, but I wanted to mention that this is what I did.
On one system we are developing, to control concurrent users (for licensing purposes), I created record locks. That seems to work fine. (Search for an unlocked record in a special table, and lock it - if the first locked record is greater than a certain number, give warning of too many concurrent users, and exit). Note that this solution only counts users; it doesn't tell you who is logged in.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)