WebBrowser Control causes whole application to become unresponsive

孤街浪徒 提交于 2019-12-22 06:49:44

问题


I have a C# .NET 3.5 application with an embedded web browser. The browser is designed to point to remote sites (Rather than anything local). Everything works fine, but when the page is slow to respond this causes my entire application to become unresponsive until the page is loaded.

I don't mind the browser being unresponsive while it does its thing, but the application going too is far from ideal.

Is there a good way to prevent this? Would it be beneficial to run the WebBrowser on a seperate thread - that's a bit beyond my skillset right now and I don't think the WebBrowser control really likes multithreading? But I can learn if needs be.


回答1:


See the answer #2 on this question for a solution on how to run it on a separate thread: BackgroundWorker and WebBrowser Control

You might as well read answer #1 too, it explain the behaviors you are seeing (WebBrowser control blocking UI thead).




回答2:


As it happens I found that the root cause of this was my application running as administrator. Exactly the same issue was seen when using Internet Explorer - as such, I've simply rewritten the bits that required admin privileges so I'm now no longer seeing the original issue.




回答3:


this happened only on win7;I use fiddler2 to Monitor HTTP/HTTPs traffic .I find embedded web browser to visit this web:http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab?50ff94e72ac1a75c;the solution is follow:http://support.microsoft.com/kb/2730040/en (Method 2 or Method 3).you can try it.other u can use .net framework4.0,then u haven't this problem.



来源:https://stackoverflow.com/questions/10981206/webbrowser-control-causes-whole-application-to-become-unresponsive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!