Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9100365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:50:47+00:00 2026-06-17T00:50:47+00:00

I have a C# standalone Windows Forms application. It connects to a back office

  • 0

I have a C# standalone Windows Forms application. It connects to a back office system that requires the workstation name as part of the identification process. I’m using Environment.MachineName to get this. However the customer using this application will occasionally run it under a Citrix environment and, when they do, they want it to reference the remote machine name, not the machine it is installed on. I have never coded anything like this before, and am unfamiliar with Citrix (so I’m off to a flying start). How do I get the remote machine name? Any ideas hugely appreciated.

Big thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:50:48+00:00Added an answer on June 17, 2026 at 12:50 am

    On a Citrix systems there’s an Environment Variable called CLIENTNAME that has the name of the machine that the user is connecting to Citrix from. It’s just a regular Windows environment variable so you can use Environment.GetEnvironmentVariable to read it.

    You could do something quick and dirty like this:

    var workstationName = Environment.GetEnvironmentVariable("CLIENTNAME") ?? Environment.MachineName;
    

    For something a little more robust, a Citrix environment also has a SESSIONNAME variable that identifies the Citrix session. The presence of these two variables together is probably a better test for running in a Citrix session.

    So you could do something like this:

    public bool IsCitrixSession() {
        return Environment.GetEnvironmentVariable("CLIENTNAME") != null
            && Environment.GetEnvironmentVariable("SESSIONNAME") != null;
    }
    
    public string GetWorkstationName()
    {
        return IsCitrixSession() ? Environment.GetEnvironmentVariable("CLIENTNAME")
                                 : Environment.MachineName;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standalone java application that fires up several JMS consumers using the
Does anyone have experience of rapidly translating an access application into a standalone windows
I have a standalone version of Perl for Windows (5.004) that does not include
I am working on a .NET 3.5 Windows Forms application that will interact with
I have a WinForms Form that used to be a standalone application, but is
I have a windows application that uses an assembly that stores some configuration settings
I have a standalone application in which I have to prompt the user with
I have a standalone application, and one of its duties is to take the
Hai I have developed a standalone application in which when an user logs in,
I have many structs (classes) and standalone functions that I like to compile separately

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.