Wednesday, 17 August 2011

Detect a Terminal Server session

For a project I'm currently working on, I needed to determine if the session the app is running in is a TS session.

Well, It's this easy:
/// <summary>
/// Detect if app is running through a remote session, like terminal-services
/// </summary>
public static bool IsRemoteSession()
{
    return System.Windows.Forms.SystemInformation.TerminalServerSession;
    // TODO: Citrix check
}
OK, I'm trying to get the code-formatting working in Blogspot. This will have to do for now!
As you can see, I'm still looking to see how to get this right when running in Citrix, so I'll have to get back to this once I've got a 2008 VM installed with Hyper-V enabled, in order to mount the Citrix server I've just downloaded for evaluation.

No comments:

Post a Comment