晕!这么长时间了就等了这么一句话俺还是回家自己解决问题了

解决方案 »

  1.   

    回家看了一些多线程的资料用这样的方法可以实现:定义一个类class threadProc
    {
       int static num = 0;
       Thread thread ;
      stirng iphead ;
       int start = 0;
       public void run(int start,string ipHead)
      {
         start  = start 
    iphead  = ipHead;
          thread = new Thread(new ThreadStart(threadrun));
          thread。start();
          
      }
      private void threadrun()
      {
          while(start〉num )
               num++;
      for(int i=0;i<5;u++)
    {    
      num++
         搜索局域网中是否存在ip为iphead+num。tostring的机器
    }
          
    }然后在主函数中建立多个类的实列可以实现扫描
    如果将类threadProc中的num定义为实列变量然后传递过来ip的起始与结束的范围
    原理上可以实现但是实际运行有错误不知道为什么?
      

  2.   

    用线程池只是管理线程调度的而我的问题是多线程调用同一个线程代理的问题