问题描述
我在找一个API /功能,我可以打电话,以确定是否软件在Citrix,终端服务,或独立的PC上运行。理想情况下,它的工作是这样的:
I'm looking for an API/function I can call to determine if software is running on Citrix, Terminal Services, or a stand-alone PC. Optimally, it would work something like this:
Select Case APIWhatSystem.Type.ToString
Case "Citrix"
bCitrix = True
Case "TS"
bTerminalServices = True
Case "PC"
bPC = True
End Select
我想preFER东西,从API调用的工作,而不是看在注册表中的东西,因为我们遇到被锁定注册表越来越多的客户。
I would prefer something that worked from an API call as opposed to looking at something in the registry as we're having more and more customers that are locking down the registry.
感谢。
推荐答案
据:<一href=\"http://forums.citrix.com/message.jspa?messageID=1363711\">http://forums.citrix.com/message.jspa?messageID=1363711您可以检查SESSIONNAME环境变量。
According to: http://forums.citrix.com/message.jspa?messageID=1363711 you can check the SESSIONNAME environment variable.
另一种更简单的方法是阅读系统环境变量SESSIONNAME。如果它存在,并以ICA那么你Citrix会话中运行启动。如果它以RDP开头那么你RDP会话中运行。
我和我的电脑测试,并在本地获得:
I tested it with my PC and locally I get:
C:\>echo %SESSIONNAME%
Console
虽然远程我
C:\>echo %SESSIONNAME%
RDP-tcp1
所以看起来它可能是一个简单的路线走,否则它听起来像检查注册表值或某些dll文件存在,将是下一个最好的事情。
So it seems like it might be an easy route to go, otherwise it sounds like checking for registry values or if certain dlls exist will be the next best thing.
这篇关于为确定API,如果应用程序正在运行在Citrix或终端服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!