当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“8856f961-340a-11d0-a96b-00c04fd705a2”
2013-07-05 09:03 awenwang 阅读(1592) 评论(0) 收藏 举报使用webBrowser截图时出现这样一个错误:

查找了下,大部分人说的解决方法如下:
System.Threading.ThreadStart start =new System.Threading.ThreadStart(download);
System.Threading.Thread th =new System.Threading.Thread(start);
th.ApartmentState = System.Threading.ApartmentState.STA;//关键
或者
[STAThread]
staticvoid Main(string[] args)
{
}
而我最后使用的解决办法是在页头加上AspCompat="true"属性即可,不妨试试看...http://www.cnblogs.com/pfs1314/archive/2011/06/07/2074169.html
浙公网安备 33010602011771号