Skip to content

ClientName from C#

Corey Tracey

Asked Mar 27, 2006, 10:33 AM EST3 answers
Share
LinkedInX
I am on my 2nd c# app and have a question. I would like to acquire the "clientname" from my Windows2k3 server. I currently get the server's "computername" via this.strMachineName = Environment.MachineName.ToString(). I would like to get the "clientname", the client which is connected to the server. I can see the data by running from a server command prompt, "set". Is there a C# function or class that would have this? I've looked at SystemInformation and the environment class with no luck. Thanks

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    The "clientname" from the set command returns the end device host name. I already use the Environment.UserName to get the AD account name. I need to get the end device host name/dns name.
    0
  • 0
    found it.... string clientname = Environment.GetEnvironmentVariable("CLIENTNAME"); MessageBox.Show(clientname);
    0
  • 1 short reply
    • 0
      Use:
      Environment.UserName
      0