Thread t = null;
for (int i = 1; i <= 5; i++)
{
t = new Thread(searchthead);//searchthead为查找文件的方法 返回字符串数组
t.Start();
}
但这样用,会查找出5个同样的文件出来,怎样当一个线程查找过的文件,另一个线程就不去查了?
...全文
77038打赏收藏
c#多线程查找文件问题
比如 Thread t = null; for (int i = 1; i <= 5; i++) { t = new Thread(searchthead);//searchthead为查找文件的方法 返回字符串数组 t.Start(); } 但这样用,会查找出5个同样的文件出来,怎样当一个线程查找过的文件,另一个线程就不去查了?