我刚入门,想找一程序学习,在网上下载了个c#的程序webFinder.zip,可是运行不起,调试过好象发现是线程有问题,想请大家帮忙解决下在单步调试时出现了如下错误
未处理的“System.Threading.ThreadStopException”类型的异常出现在 system.windows.forms.dll 中。其他信息: 线程正被停止。请各位大哥大姐帮忙看下啊

解决方案 »

  1.   

    可能是你在应用中没有添加system.windows.forms.dll 
    他是winform的程序,就需要system.windows.forms.dll  的dll
    你可以重新添加一下应用,这个dll是系统自带的。
      

  2.   

    System.Threading.ThreadStopException google吧
      

  3.   

    我有检查了system.windows.forms已经被引用了,配置文件没有真是郁闷
      

  4.   

    代码如下:begin_Click里调用了线程,线程里调用过程SpiderThread()我调试的时候执行到*********处就开始报我帖子里提示的错误了,我不知道该怎么样处理了,谢谢大家

                    private void begin_Click(object sender, System.EventArgs e)
    {
    ThreadStart starter = new ThreadStart(this.SpiderThread);
    Thread spider = new Thread(starter);
    spider.Start();
    } public void SpiderThread()
    {
    if( begin.Text.Equals("Cancel") )
    {
    m_spider.Quit = true;
    begin.Enabled = false;
    }
    else
    {
    begin.Text = "Cancel";**************
    targetURL.Enabled = false;******************
    threadCount.Enabled = false;
    outputDir.Enabled = false; m_spider = new Spider();
    m_spider.ReportTo = this;
    m_spider.OutputPath = outputDir.Text;
    int threads = int.Parse( threadCount.Text);
    if(threads<1)
    threads = 1;
    threadCount.Text = ""+threads;
    try
    {
    m_spider.Start(new Uri(this.targetURL.Text),threads);
    }
    catch( UriFormatException ex)
    {
    System.Windows.Forms.MessageBox.Show( ex.Message );
    return;
    } begin.Text = "Begin";
    targetURL.Enabled = true;
    threadCount.Enabled = true;
    outputDir.Enabled = true;
    begin.Enabled = true;
    } }
      

  5.   

    这是代码 private void begin_Click(object sender, System.EventArgs e)
    {
    ThreadStart starter = new ThreadStart(this.SpiderThread);//调用下面那个过程SpiderThread()
    Thread spider = new Thread(starter);
    spider.Start();
    } public void SpiderThread()
    {
    if( begin.Text.Equals("Cancel") )
    {
    m_spider.Quit = true;
    begin.Enabled = false;
    }
    else
    {
    begin.Text = "Cancel";
    targetURL.Enabled = false;//执行到这步,就报帖子上的错误了
    threadCount.Enabled = false;
    outputDir.Enabled = false; m_spider = new Spider();
    m_spider.ReportTo = this;
    m_spider.OutputPath = outputDir.Text;
    int threads = int.Parse( threadCount.Text);
    if(threads<1)
    threads = 1;
    threadCount.Text = ""+threads;
    try
    {
    m_spider.Start(new Uri(this.targetURL.Text),threads);
    }
    catch( UriFormatException ex)
    {
    System.Windows.Forms.MessageBox.Show( ex.Message );
    return;
    } begin.Text = "Begin";
    targetURL.Enabled = true;
    threadCount.Enabled = true;
    outputDir.Enabled = true;
    begin.Enabled = true;
    } }
      

  6.   

    有两中方法可以解决
    一种是调试的时候用单线程调试
    第二种是 把begin.Text = "Cancel"; 改成 this.begin.Text = "Cancel";
    把后面的控件前面都加上(this.) 就可以了