Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Tracking user logon in windows application

paulmorrisonpaulmorrison Member Posts: 127
I'm looking for code or examples of tracking users logged into an application. Of course, that assumes that users must log in first. The practical application of this would be producing a distributable windows application that is licensed by the number of users. My only thoughts would be to create a database of users and then create a field to be used when they log in and logout.

Comments

  • raymcdraymcd Member Posts: 284
    : I'm looking for code or examples of tracking users logged into an application. Of course, that assumes that users must log in first. The practical application of this would be producing a distributable windows application that is licensed by the number of users. My only thoughts would be to create a database of users and then create a field to be used when they log in and logout.
    :
    :

    Create a "token" in the database for each user logged in. Assign each session a GUID. Make all the user communication based on the guid. GUIDs should have an expiration time limit like the session timeout in IIS. Refresh the expiration time whenever the token/GUID is used. When logging someone in, all you have to do is count the valid tokens.

    If the application can maintain state (IE not http based), all you need to do is some kind of reference count on a shared resource. You could create a DotNet remoting type and use it to authenticate/count the users.

    I have some excellent sample code that you might want to use. Email me at ray_mcdowell@hotmail.com

    -ray
Sign In or Register to comment.