We have a service in our project that runs and we need it to get a command on log off. We could send a command via our console, but the console is a separate program which could not be running. It does not necessarily need to stop, but it does need to get a command of some sort. Is there anything with in the service which can catch a Log Off event?
[10/17/12 10:45] - The service is running as Local System.
[10/17/12 12:07] - I added the following method, but I am not getting any output when I log off or onto the computer even though I am successfully writing to the log with this message I will try again rebuilding my solution, but wanted to post this here in case I am doing something wrong.
protected override void OnSessionChange(SessionChangeDescription changeDescription)
{
WriteToDebugLog(new string[] { "OnSessionChange()",
DateTime.Now.ToLongTimeString() + " - Session change notice received: " + changeDescription.Reason.ToString() + " Session ID: " + changeDescription.SessionId.ToString(),
"Information" });
base.OnSessionChange(changeDescription);
}