Environment.MaschineName with Citrix

Normally the property MaschineName of the class Environment contains the NetBIOS name of the pc. If the user runs the application in a Citrix environment, it contains the name of the Citrix server which hosts the current session.

In my application this behavior led some settings of some user to be overwritten by another user, because it was actually the same pc / server. And unfortunately it costs me a lot of time to figure out.

The avoid this, the environment variable CLIENTNAME can be used. In a Citrix session this variable is not null and contains the NetBIOS name of the pc.

String mName = Environment.GetEnvironmentVariable("CLIENTNAME") ?? 
		Environment.MachineName;
Advertisements
This entry was posted in C#, Development and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s