Detecting if running on Citrix or Terminal Servcies

Is there an API or other method to tell if an application is running on a server with terminal services or Citrix?
[114 byte] By [Jim Bassett] at [2007-11-18 20:32:30]