我的程序结构式这样
Thread  thread;
for(int i=0;i<10;i++)
{
 thread= new Thread(new ThreadStart(abc));
 thread.name="下载"+i;
thread.start();
}
public void abc()
{
//下载文件的代码
}请问如果我在某个文件下载中的时候要暂停下载,或者直接停止线程下载,关闭掉那个线程,应该怎么弄啊

解决方案 »

  1.   

    Thread thread;定义为全局数组..
      

  2.   

    thread.Abort();//直接结束线程
    thread.Suspend();//挂起线程
      

  3.   

    是怎样呢?是定义为Thread[] thread?然后怎样操作呢?
      

  4.   

    thread.abort();停止线程
    暂停线程最好用互斥做,因为MS提供的方法不稳定
      

  5.   

    我博客有一个以前写的线程,每次都阻塞自己,暂停等待的例子。带有消息机制的线程 - CustomMessageQueue(c#)