The only workaround I can think of for this would be to place an
application in the startup directory for a user. Then, when the user logs
in, the application will start, and send a message to your service.
The only other way to do this would be to replace GINA.dll (which is
used on windows machines for authenitication purposes), but that requires
unmanaged code, which C# can not produce.
On XP and higher you can use "local policies" to turn on "Logon auditing",
this will log the Logon event into the security eventlog. Your service can
then read the eventlog at regular intervals (and parse Message ID
551=Logoff, 528 = Logon) or, you can use System.Management's namespace
ManagementEventWatcher and WMI to listen for security log events.
Another option, again on XP and higher) is the use System.Management's and
watch for Win32_LogonSession (WMI) instance creation events.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.