通过 .NET 中的 Citrix 会话获取本地计算机名称
我需要通过 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到一个服务器变量,如 Kobi 上面建议的:
%CLIENTNAME%
,它仅填充在终端服务或 Citrix 中,在本地 PC 上展开它将返回
%CLIENTNAME%
。然而,在 Citrix 或 RDP 服务器上它运行得很好。我使用的.net代码是:TSHostName = Environment.ExpandEnvironmentVariables("%CLIENTNAME%")
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%")