另一个SendKeys - 用于Citrix。 [英] Another SendKeys - Used in Citrix.
本文介绍了另一个SendKeys - 用于Citrix。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
有谁知道发送密钥的其他方式。我在Citrix上使用SendKeys.Send({ENTER} {TAB})时遇到了问题(它类似于DOS基本键控/输入,连接到服务器)。不知何故,像输入和标签这样的特殊键不起作用,但是[AZ] [0-9]很好。
请帮助。
谢谢。
BTW,发现这篇文章但参考文献遗失,很难找到互联网
SendKeys使用ScanCodes到Citrix [ ^ ]
推荐答案
SendKeys
由于多种原因而非常糟糕。在Windows中模拟输入事件的真正通用方法是SendInput
:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85% 29.aspx [ ^ ]。
您可以通过P / Invoke使用它,这已经为您完成了:http://www.pinvoke.net/default.aspx/user32.sendinput [ ^ ]。
并向您发出警告:尽量远离技术滥用。需要模拟输入的情况非常少见;玩键盘(键盘/鼠标)宏就是其中之一;另一个应用程序可能是UI测试工具。例如,不应在UI开发中使用输入模拟。
-SA
SendKeys
is a pretty bad thing, by a number of reasons. The really universal ways to simulate input events in Windows isSendInput
:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^].
You can use it via P/Invoke, which is already done for you: http://www.pinvoke.net/default.aspx/user32.sendinput[^].
And a word of warning for you: try to stay away from technology abuse. The cases when you need to simulate input are quite rare; playing keyboard (keyboard/mouse) macro is one of them; another application could be UI testing tools. Simulation of input should not be used in UI development, for example.
—SA
这篇关于另一个SendKeys - 用于Citrix。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文