我想通过我的 Web 应用程序创建网站缩略图,所以我想我会使用 WebBrowser 控件。但是,我收到一个错误:
System.Threading.ThreadStateException: ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.
我尝试设置当前线程:
Thread.CurrentThread.ApartmentState = ApartmentState.STA
但这并没有帮助。
无法在 ASP.NET 中使用 WebBrowser 控件吗?
最佳答案
是的,你可以使用它,它比设置 AspCompat="true"稍微复杂一点,看看是否有帮助
http://www.beansoftware.com/ASP.NET-Tutorials/Get-Web-Site-Thumbnail-Image.aspx
关于asp.net - 在 ASP.NET 应用程序中使用 WebBrowser 控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1054404/