我如何知道我的应用程序在一个RDP会话中运行 [英] How do I tell if my application is running in an RDP session
问题描述
我有一个.NET的WinForms应用程序,它有一些动画效果,淡入和滚动动画等,这些做工精细但是如果我在一个远程桌面协议会话的动画开始篦。
I have a .net winforms app which has a few animation effects, fade ins and scroll animations etc. These work fine however if I'm in a Remote Desktop Protocol session the animations start to grate.
有人建议确定的方式在RDP会话的应用程序是否在运行,所以我可以在这种情况下,关闭的影响了吗?
Can someone suggest a way of determining whether or not an app is running across an RDP session so I can turn the effects off in this case?
推荐答案
假设你至少在.NET Framework 2.0中,有没有必要使用的P / Invoke:只检查系统的价值.Windows.Forms.SystemInformation.TerminalServerSession
(<一href="http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.terminalserversession(VS.80).aspx">MSDN).
Assuming you're at least on .NET Framework 2.0, there's no need to use P/Invoke: just check the value of System.Windows.Forms.SystemInformation.TerminalServerSession
(MSDN).
这篇关于我如何知道我的应用程序在一个RDP会话中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!