c# how to determine session id of specific logged in windows user
问题 like the title said, i want to create a method to search a windows user session id by the domainname\username. I already finished to read the currently logged in users, but id do not know to determine their session id. My goal is to kill the session of specific users. 回答1: Based on the code from: How do you retrieve a list of logged-in/connected users in .NET? Modified a bit, the following code will list the logged in users and their corresponding session ids. class Program { static void Main