How do I find out who is associated with an application in WPF?

HI Everything, I want to start working on a new function for me, in my project I have a database (with SqlServer) and an application (development in WPF), the purpose of this application is to manage / manage accounting and other department, so I created passwords and roles (for users) to access in the application, now I will create a system to find out how many Usera is connected to the application (via the database) and show what is in the listBox (for example, as a normal chat application I want to know who is online and offline), but I don't know where I need to start this work, I am weird about this feature, so if you have any suggestions, links and I would be very grateful for your help.

Many thanks.

PS if my question is not clear, I rewrote it ... kind of sorry while waiting

+1


a source to share


2 answers


Without knowing the details of your application, I would suggest setting the timestamp field in the database on login, then setting it again every X minutes while they are logged in. This has two advantages over setting a flag:

1) If the application crashes or the user's machine crashes, the flag will not be reset and you will not be able to know that they are not logged in yet.



2) The timestamp will tell you the last time each user logged in, even if they are not currently logged in.

+1


a source


Maybe in the database itself? When a user logs in, you can set the flag for each user "LoggedInd = true" and when logged out "LoggedIn = false". And make a query for this flag "SELECT * FROM Users WHERE LoggedIn = true"



+1


a source







All Articles