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

前端之家收集整理的这篇文章主要介绍了C# - The differences between SendKeys.Send and 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.

猜你在找的PHP相关文章