问题描述
我需要在本地计算机名称,通过Citrix会话运行我们的软件应用程序,一台台式电脑。当我查询 My.Computer.Name
我得到的服务器的名称。
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?
推荐答案
发现服务器变量上面了Kobi提示:
Found a server variable as Kobi suggested above:
%CLIENTNAME%
它只是填充在终端服务或Citrix,你扩展它的本地PC将返回%CLIENTNAME%
。然而,思杰或RDP服务器上它的伟大工程。在.NET code我现在用的就是:
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%)
这篇关于通过在.NET Citrix会话获取本地计算机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!