473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Detecting Terminal Server in VB.Net

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
Mar 2 '06 #1
1 2498
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]

"Hitesh" <Hi****@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.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

Mar 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TPoise! | last post by:
Using: .NET 1.1, Visual Studio 2003, C#, Microsoft Windows 2000 Server (SP4 and all latest windows updates), Terminal Server running in application mode. I have a C# application that I've...
8
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
6
by: Atley | last post by:
I have a Terminal Services server running Windows 2000 Server. I need to be able to identify, in my application on that server, which client computer is addressing that server and running that...
0
by: Microsoft News | last post by:
Anyone knows how to find out how many instances of Terminal Server is running? If I have a Terminal server that has 5 licenses and 4 user's logon I want to know how to find out that 4 users are...
3
by: shawn | last post by:
In the past I have had SQL and Terminal server on the same PC. With SQL and Windows 2003 Terminal server, you can not have them on the same PC. How can I make this work with SQL and Terminal and...
5
by: cityrock | last post by:
Hello friends. It has come time for me to face a dilema i have been thinking about for a long time, but actually doing nothing. Now its time to act. The situation is "simple", and i have just...
7
by: mike | last post by:
We have numerous Access 97 apps that we run on our Terminal Server, but two apps in particular is giving us a problem. The problem we are running into is when you select a drop down menu, it errors...
10
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
16
by: =?Utf-8?B?RHdlZWJlcmVsbGE=?= | last post by:
I created an Access 2007 application for my customer. The application is shared by three employees on a server. It maintains a contact list including financial data and social security numbers. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.