SessionChange

  protected override void OnSessionChange(SessionChangeDescription changeDescription)
        {
            System.IO.File.AppendAllLines(@"D:\INX.TXT", new List<string> { DateTime.Now.ToString() + "  ----------" + changeDescription.Reason + "   |||   " + changeDescription.SessionId + "   】 " + Environment.UserName });
            //base.OnSessionChange(changeDescription);
            switch (changeDescription.Reason)
            {
                case SessionChangeReason.ConsoleConnect:
                    break;
                case SessionChangeReason.ConsoleDisconnect:
                    break;
                case SessionChangeReason.RemoteConnect:
                    break;
                case SessionChangeReason.RemoteDisconnect:
                    break;



CanHandleSessionChangeEvent = true;



Microsoft.Win32.SystemEvents.SessionEnding+=

  

posted @ 2017-10-13 11:37  hi.....  阅读(379)  评论(0编辑  收藏  举报