G
Guest
Hi,
I need code in VB.Net to detect if the application is running on Terminal
Server.
I am using the following code. Please let me know if you see any issues in
it or if you have some better code to achieve this functionality:
Dim sTemp As String = Environment.GetEnvironmentVariable("SESSIONNAME")
Dim IsTSSession As String
If (sTemp <> "") And (sTemp.IndexOf("RDP-") = 0) Then
IsTSSession = True
Else
IsTSSession = False
End If
Thanks,
Hitesh
I need code in VB.Net to detect if the application is running on Terminal
Server.
I am using the following code. Please let me know if you see any issues in
it or if you have some better code to achieve this functionality:
Dim sTemp As String = Environment.GetEnvironmentVariable("SESSIONNAME")
Dim IsTSSession As String
If (sTemp <> "") And (sTemp.IndexOf("RDP-") = 0) Then
IsTSSession = True
Else
IsTSSession = False
End If
Thanks,
Hitesh