Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been searching on google, codeplex, codeproject, stackoverflow, dream.in.code... nothing seems to be coming up.

My final result for this project is to have a service that is running in a computer lab. As soon as a user logs on, the service running will send the user information, the computer name and a 'logged in' bool to a server. The server is only keeping the 'logged in' status for that computer name, but using the user information to see if it has any messages for that category of user. Then, when the user logs off, the service sends the computer name and a 'logged off' bool to the server.

I don't have a lot of experience with WCF or coding for Windows events, so I'm lost when it comes to getting a part of the service to trigger with a user logon/logoff.

I can get all the information that I need if I use a windows form and trigger the data collection with a button click, but that doesn't help when using it as a wcf.

So, does anyone have any advice as to how to get the method to run when the user logs in or logs out? Thanks in advance! This hunt for a needle in a haystack is making my head spin :-)
Posted

1 solution

Write a Windows service that lives on the server. All it does is listen for client connections. When it receives one, it sends back any data for that user that is pending.

Write a SECOND windows service that lives on a given client's machine. This service will notify the server that the user logged in, and will receive the data that the server sends back (if any), and stores it in a local data file.

Write a system tray application that talks to the local client service and displays notifications received from the server.

Go forth, and code.
 
Share this answer
 
Comments
AngieLeigh 26-Dec-11 10:17am    
Thanks for the quick reply! I already have those set up :-)
What I'm stuck on is getting the local client service to tell the server that the user has logged in. I know there has to be some simple way to do it, but like always, I love over complicating things and then the blonde hair kicks in and I get confused haha ;-)
#realJSOP 26-Dec-11 12:38pm    
You want to capture the Logon/Logoff WMI Win32_LogonSession events.
AngieLeigh 27-Dec-11 8:36am    
Thanks John! :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900