I'm trying to get the current logged (in my app) user in every winform of my app, but I don't know how to differentiate between multiple logged users in the app.
I have an ActiveUsers
SQL Table with SessionID
and UserID
to identify a single user.
Also how can I close the session (delete the userid
from the ActiveUsers
table) if the app is terminated abnormally?
Any help?
Edit: The app is composed of several winforms and is intended to run in multiple Pcs at the same time. Users are created in the application and stored in SC_User
table with UserID
as PK. The ActiveUsers
table has UserID
as FK and SessionID
as PK. What i want is to get the UserID
of the user using the applicattion in any winform and use it to for example change the app language preference of the that user. For a single user i insert the UserID
in the ActiveUsers
when login and delete when logoff.