FtpClient文件下载 : http://download.csdn.net/detail/pukuimin1226/4388499
第一种不使用WebClient
private void ftp_op1()
{
WebClient wc = new WebClient();
//wc.Credentials = new NetworkCredential("pkm", "123456");//没有加就是匿名用户
wc.DownloadFile("ftp://127.0.0.1/test.txt", "c:/test.txt");
// MessageBox.Show("文件(test.txt)下载成功!");
wc.UploadFile(ftp://127.0.0.1/test.txt, "c:/test.txt"); //要有上传权限!
}
第二种使用FtpClient(可以说用FtpClient比不用时,操作时要强得多)
private void ftp_op2()
{
FtpClient fc = new FtpClient("127.0.0.1", "pkm", "123456");
fc.Download("test.txt", "c:/test" + DateTime.Now.ToString("yyyy_MM_dd").Replace(" ", "") + ".txt");
}