通过 .NET 中的 Citrix 会话获取本地计算机名称

发布于 2024-09-11 04:04:29 字数 163 浏览 14 评论 0原文

我需要通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

糖粟与秋泊 2024-09-18 04:04:30

找到一个服务器变量,如 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%")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文