程序员人生 网站导航

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

栏目:php教程时间:2014-12-11 08:57:27

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.

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐