从一个ftp位置快速压缩并解压缩到另一个位置。 C# [英] Zip and unzip on the fly from one ftp location to another. C#

查看:165
本文介绍了从一个ftp位置快速压缩并解压缩到另一个位置。 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从ftp文件夹中获取一组文件或单个文件,将其压缩,将其带到ftp中的另一个文件夹,解压缩并存储?整个过程应该是动态的,不需要在本地系统中存储任何文件。

请帮助。

How can i pick up a set of files or a single file from a ftp folder, zip it, take it to another folder in the ftp, unzip it and store it? The whole process should be on the fly, without storing any files in the local system.
Please help.

推荐答案

如果你真的需要它在运行中,你不能使用可用的FTP客户端应用程序,需要创建自己的插件额外处理。这不是太难。您可以将代码基于一些可用的开源FTP客户端库,如下所示:

简单的C#FTP类 [ ^ ],

http://netftp.codeplex.com/ [ ^ ]。



您还需要一些ZIP算法的.NET实现。我通常建议选择SharpCompress,#ziplib和7-zip for .NET:

如何在c#中使用相同的文件名在zip文件夹中添加文件名 [ ^ ] ,

在C#4.0中压缩文件 [ ^ ]。



-SA
If you really need it on the fly, you cannot use an available FTP client application, will need to create your own where you can plug-in extra processing. This is not too hard. You can base your code on some available open-source FTP client library, something like this:
Simple C# FTP Class[^],
http://netftp.codeplex.com/[^].

You also need some .NET implementation of ZIP algorithms. I usually advise a choice from SharpCompress, #ziplib and 7-zip for .NET:
how to add file name in zip folder with same file name in c#[^],
Zipping of files in C# 4.0[^].

—SA


这篇关于从一个ftp位置快速压缩并解压缩到另一个位置。 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆