Detecting Citrix using .NET

How do you detect a Citrix Session ID using .Net?
Armon14Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mikal613Commented:
Paste from MSDN:

Monitoring Session Connections and Disconnections
For the service-side application to monitor session connections and disconnections, you must register it with Terminal Services in the following manner. First, you must store the name of the virtual channel server application in the registry. Add a subkey under the following location.

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
   \TerminalServer\Addins
The subkey can have any name. It must have a REG_SZ value, Name, that contains the symbolic name of the application.

Name = AddinName
The maximum length of both the subkey and the value of Name is 99 characters.

It must also have a REG_DWORD value that indicates the type of server application.

Type = AddinType
AddinType must be the following value.

Value Meaning
3 User-mode application, session space.


Registration of the server application takes effect only in sessions created after the registration was performed.

Each registered server application can create two event objects that are signaled when a client connects or disconnects. The names of these event objects are Reconnect and Disconnect, respectively, and have the following format:

Global\AddinName-SessionId-Reconnect
 
Global\AddinName-SessionId-Disconnect
AddinName is the string specified in the Name value of the registry subkey under which the server application is registered. SessionId is the session identifier of a client session.

The server application must create these event objects in an unsignaled state. When a client application connects or disconnects from a session, Terminal Services sets the appropriate event to the signaled state. If the user application must monitor these event objects again, it must reset them to the unsignaled state.
<end paste>

the URL: http://msdn.microsoft.com/library/psdk/termserv/wtsapi_8vhv.htm

see also: TEvent in syncobjs which is a wrapper around win32 event objects.

hope this helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.