帮助从净创建Zip文件,并从Java读取它们并从、文件、Zip、Java

2023-09-04 00:45:13 作者:栀葵

我试图创建净Zip文件,可以从Java code被读取。

I'm trying to create a Zip file from .Net that can be read from Java code.

我用SharpZipLib创建Zip文件,而且如果按照#ZipLib库的CheckZip函数生成的文件是有效的,可以成功uncom $ P $通过WinZip或WinRAR的pssed我总是得到一个错误,当使用Java.Utils.Zip类在Java中它试图uncom preSS。

I've used SharpZipLib to create the Zip file but also if the file generated is valid according to the CheckZip function of the #ZipLib library and can be successfully uncompressed via WinZip or WinRar I always get an error when trying to uncompress it using the Java.Utils.Zip class in Java.

问题似乎是在错误的标题写的SharpZipLib,我也贴在SharpDevelop的论坛,但没有结果的问题(见的 http://community.sharpdevelop.net/forums/t/8272.aspx 的信息),但没有结果。

Problem seems to be in the wrong header written by SharpZipLib, I've also posted a question on the SharpDevelop forum but with no results (see http://community.sharpdevelop.net/forums/t/8272.aspx for info) but with no result.

有人曾经COM $ P $的pssing用一个Zip文件code样品.Net和去-COM $ P $与Java.Utils.Zip类pssing呢?

Has someone a code sample of compressing a Zip file with .Net and de-compressing it with the Java.Utils.Zip class?

问候 马西莫

推荐答案

我已经使用 DotNetZip库,它似乎正常工作。典型的code:

I have used DotNetZip library and it seems to work properly. Typical code:

using (ZipFile zipFile = new ZipFile())
{
  zipFile.AddDirectory(sourceFolderPath);
  zipFile.Save(archiveFolderName);
}