Get local computer name via Citrix session in .NET

会有一股神秘感。 提交于 2019-12-23 07:46:51

问题


I need to get the local Computer Name for a desktop computer running our software application through a Citrix session. When I query My.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?


回答1:


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%")



来源:https://stackoverflow.com/questions/3329236/get-local-computer-name-via-citrix-session-in-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!