无效类型转换
使用委托操作相关控件
Invoke操作
CheckForIllegalCrossThreadCalls 

解决方案 »

  1.   

    可否说的稍微详细些!我的代码大致为:public static void SearchText(.....)       
    {
            ieWnd = new SHDocVw.InternetExplorer();
            ieWnd.Visible = true;
            ieWnd.Silent = true;
            ieWnd.Navigate("http://www.xxxxx.com", ref missing, ref missing, ref missing, ref missing);
            
            while (ieWnd.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                        Application.DoEvents();
            Thread.Sleep(2000);        ieDocNewFlt = (mshtml.IHTMLDocument2)ieWnd.Document;
            mshtml.FramesCollection iFrameCol = (mshtml.FramesCollection)ieDocNewFlt.frames;
            for (int i = 0; i < iFrameCol.length; i++)
           {
           }
    }
    在主线程中启动SearchText。
    如何修改?
    十分感谢wuyq!
      

  2.   

    http://www.cnblogs.com/TankXiao/p/3348292.html  参考很全面!