user1202434
user1202434

Reputation: 2273

How to know if wpf app is in terminal services session?

Is there an equivalent to

SystemInformation.TerminalServerSession in wpf?

I want to know if the current wpf application is running in a terminal server session. Thanks

Upvotes: 1

Views: 2436

Answers (2)

paparazzo
paparazzo

Reputation: 45096

Just add a reference to System.Windows.Forms Since you are not messing with the UI you don't need anything special.

  System.Diagnostics.Debug.WriteLine(System.Windows.Forms.SystemInformation.TerminalServerSession.ToString());

Upvotes: 1

gliderkite
gliderkite

Reputation: 8928

You could use the SystemParameters class to query system settings, especially the SystemParameters.IsRemoteSession property to get a value that indicates whether the calling process is associated with a Terminal Services client session (like SystemInformation.TerminalServerSession property).

Upvotes: 10

Related Questions