Check if no user is currently logged on to Windows
问题 I'm writing a Windows Service application which listens for connections and performs certain tasks as instructed from a different application running on another computer on the network. One of the tasks ensures no user is currently logged on, locks the workstation, delete some files, and then restarts the system. I considered using this solution to look through the list of running processes and check the user names, determining if no user is logged on by matchhing the user names against