Record Login, Logout, System Lock/Unlock event in C#
问题 I am planning a develop an application, which starts up with windows (a service perhaps) and silently records User's Login, Logout and System Lock/Unlock events.. It would be awesome if someone can give a me a tip to record their total idle time (the time where no system activity was performed by user) I am looking for a pre-developed library or something which can help me smoothly complete the project. 回答1: try it out the below code.... private enum WTS { CONSOLE_CONNECT = 1, CONSOLE