简体   繁体   English

WebBrowser的DocumentCompleted是否与调用导航的线程在同一线程上?

[英]Does WebBrowser's DocumentCompleted occurs on the same thread as the one that calls Navigate?

I'm almost sure it does but I just need to make sure. 我几乎可以确定,但是我只需要确定即可。 I don't want my app to be executing another method at the same time DocumentCompleted is being called. 我不希望我的应用在调用DocumentCompleted的同时执行另一个方法。

No, it is raised on the thread that created the WebBrowser, the one that's also pumping the message loop that keeps events on WebBrowser alive. 不,它是在创建WebBrowser的线程上引发的,该线程还注入了使WebBrowser上的事件保持活动状态的消息循环。 Calling Navigate() from a worker thread is technically possible but unwise if you want to keep your ducks in a row. 从技术上讲,可以从辅助线程调用Navigate(),但是如果您想连续放置鸭子,这是不明智的。

Yes it does (at least, according to the following picture from VS2010 debugger); 是的(至少,根据VS2010调试器的下图); 替代文字

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM