码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2014-12-04 10:15:42      阅读:369      评论:0      收藏:0      [点我收藏+]

标签:c#   sendkeys.send   sendkeys.sendwait   

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.

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

标签:c#   sendkeys.send   sendkeys.sendwait   

原文地址:http://blog.csdn.net/troubleshooter/article/details/41719997

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!