0

In Windows Server 2008 R2, the Task Manager shows that users are either "Active" or "Disconnected", but applications launched by a user will continue to run when they are Disconnected.

Is there a way in .NET for an application to detect if the user that launched it is Disconnected?

ashaquick
  • 61
  • 6
  • 1
    take a look at this thread: http://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net – codechurn Mar 29 '17 at 02:31
  • I tried it, but all it returns are empty strings. – ashaquick Mar 29 '17 at 05:33
  • 1
    Okay, I got it working. Thanks, it's what I needed. – ashaquick Mar 31 '17 at 01:33
  • Possible duplicate of [How do you retrieve a list of logged-in/connected users in .NET?](http://stackoverflow.com/questions/132620/how-do-you-retrieve-a-list-of-logged-in-connected-users-in-net) – codechurn Mar 31 '17 at 16:10

1 Answers1

0

I solved the issue by using the code from this related question: How do you retrieve a list of logged-in/connected users in .NET?

I changed the code slightly to create static class, with a method that would check the active users against the current user's name and return true if the current user is active, false if they're disconnected.

Community
  • 1
  • 1
ashaquick
  • 61
  • 6