for (int i = 0; i < niList.Count; i++)
{
NeFtpInfo neIn = niList[i];
DownLoadOneServer dlone = new DownLoadOneServer(neIn);
Thread throne = new Thread(dlone.toDownLoadOne); //注意這塊是函數名,不加"()",而不是函數調用
throne.Start();
}
Class Object = new Class();
Thread th = new Thread(Object.Method);
th.start();
using System;
using System.Collections.Generic;
using System.Text;
namespace FTPDownLoad
{
class DownLoadOneServer
{
NeFtpInfo nfi = new NeFtpInfo();
public DownLoadOneServer(NeFtpInfo nfi)
{
this.nfi = nfi;
}
public void toDownLoadOne()
{
FtpHelper ftphelper = new FtpHelper(nfi.ServerIP, nfi.UserName, nfi.Password);
ftphelper.DownLoadDirectory(nfi.ServerPath, nfi.LocalPath);
}
}
}
posted on 2008-09-26 17:45
天書 閱讀(871)
評論(0) 編輯 收藏 引用