|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Detecting Terminal Server in VB.NetHi,
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 Let me know if we can use something as SM_REMOTESESSION in VB.Net Thanks well perhaps
Dim sTemp As String = Environment.GetEnvironmentVariable("SESSIONNAME") Dim IsTSSession As Boolean=False If not string.isnullOrEmpty(sTemp) AndAlso sTemp.IndexOf("RDP-") = 0 Then IsTSSession = True End If ;-) regards Michel Posseth [MCP] Show quoteHide quote "Hitesh" <Hit***@discussions.microsoft.com> wrote in message news:2AA30D7C-B8EC-4A9F-AC03-20BBFCBA5A59@microsoft.com... > 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 > > Let me know if we can use something as SM_REMOTESESSION in VB.Net > > Thanks > >
delete row from dataview
Source and design in two windows SELECT @@IDENTITY Convert double to string How to put all code generated by the designer in external files (VS2005) ? .NET 2.0 Conversion Wizard Flags Me.Cursor? How to use a PDB file fonts at runtime Property 'FlowBreak' accessible only at design mode ? Read a text file word by word |
|||||||||||||||||||||||