-1

I'm working on a program that will allow users to connect to one of three accounts on a terminal server. They will be able to choose between an internal connection or an external connection, depending on whether they're working in the office or at home.

Only one user can use an account at any given time, so I'm trying to make it so the program will deny access if a user is already connected - but I am encountering issues.

  1. I'm using the Shell function to run batch files which connect to the terminal server. This is cheap way of doing things, and it doesn't work well: Remote Desktop Connection remembers login attempts to the same server, so sometimes it connects me to the wrong account. I can't choose the connection type through this method either.

  2. I've been looking at ways to detect whether a user is still logged in or not, but I don't know what will work. Something that will read/write a log file on the terminal server would be an option, I don't know how to go about it though.

Is there anything in VB.NET that will allow me to do the above?

Tops
  • 1
  • 2
  • [SO] is not a code writing or tutorial recommendation service. But I would suggest taking a look at the [Remote Desktop ActiveX](https://msdn.microsoft.com/en-us/library/hh339677%28v=vs.85%29.aspx) control. – Richard Jan 29 '15 at 14:52

1 Answers1

0

I think the trick you can use is when the user log off the app send some sort of signal or a goodbye message then on your server you will have to modify it to close all connections to that client that has logged out tracing by the goodbye message I think that will help, I've done something close to this except I wasn't logging out any user but used the received message to trigger the client to do something else using a Winsock tool.