开发者

Get local computer name via Citrix session in .NET

开发者 https://www.devze.com 2023-01-09 06:27 出处:网络
I need to get the local Computer Name for a desktop computer running our software application through a Citrix session. When I query M开发者_如何学Cy.Computer.Name I get the name of the server.

I need to get the local Computer Name for a desktop computer running our software application through a Citrix session. When I query M开发者_如何学Cy.Computer.Name I get the name of the server.

How can I get the name of the actual physical computer that the session is running on, and is there there an event I can monitor for when someone switches a session from one computer to another?


Found a server variable as Kobi suggested above:

%CLIENTNAME%

it is only populated in Terminal Services or Citrix, expanding it on you local PC will return %CLIENTNAME%. However, on a citrix or RDP server it works great. The .net code I am using is:

TSHostName = Environment.ExpandEnvironmentVariables("%CLIENTNAME%")

0

精彩评论

暂无评论...
验证码 换一张
取 消