国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > php教程 > C# - The differences between SendKeys.Send and SendKeys.SendWait

C# - The differences between SendKeys.Send and SendKeys.SendWait

来源:程序员人生   发布时间:2014-12-11 08:57:27 阅读次数:2929次

SendKeys.Send: Sends keystrokes to the active application. That's all.

SendKeys.SendWait: Sends the given keys to the active application, and then waits for the messages to be processed.

So, use SendWait to send keystrokes or combinations of keystrokes to the active application and wait for the keystroke messages to be processed. You can use this method to send keystrokes to an application and wait for any processes that are started by the keystrokes to be completed. This can be important if the other application must finish before your application can continue.

For example, if your webpage need to install a xxx.msi to continue, when the webpage pops up a bottom bar to install xxx.msi, you should use SendKeys.SendWait to trigger the installation, not SendKeys.Send.

生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生