如何在ftp服务器上创建zip文件,并将zip文件从ftp下载到客户端PC windows应用程序

问题描述:

如何在ftp服务器上创建zip文件,并从c#中的ftp下载zip文件。



how to create zip file on ftp server and download zip file from ftp in c#.

public static void SaveFile(string[] MainDirs, string FileName, Uri FTPServer, string UserName, string Password)
       {
           try
           {
              ZipFile.CreateFromDirectory(FTPServer, FTPServer + FileName,CompressionLevel.Optimal, true);
}

你用什么库来创建.ZIP文件?



很有可能你无法在FTP服务器上创建.ZIP。您必须在本地创建它,然后将生成的.ZIP上传到FTP服务器。
What library are you using to create the .ZIP file??

Chances are really good that you cannot create the .ZIP on the FTP server. You have to create it locally and then upload the resulting .ZIP to the FTP server.