Use java.util develop a C#.net zip tools
ze.setMethod(ZipEntry.DEFLATED);
os.putNextEntry(ze);
java.io.FileInputStream fs = new java.io.FileInputStream(string.Concat(FolderName, fileInfo.Name));
sbyte[] buff = new sbyte[1024];
int n = 0;
while ((n = fs.read(buff, 0, buff.Length)) > 0)
{
os.write(buff, 0, n);
}
fs.close();
}
for (int j = 0; j < (int)strs2.Length; j++)
{
string str2 = strs2[j];
DirectoryInfo directoryInfo = new DirectoryInfo(str2);
ZipFolder(string.Concat(FolderName, directoryInfo.Name, "\\"), ZipFileName, string.Concat(Addon, directoryInfo.Name,"\\"), os);
}
}
4. Notice: .NET Framework 1.1 and 1.0 have some bug with vjslib.dll, the zipped file will have some head errors, but the content is fine, it can still be opened by winzip and winrar, but you will have some problem when open the zipped file by using wjslib.dll in your code. Ironic?
Framework 2.0 fixed the problem.
5. another solution is http://msdn.microsoft.com/msdnmag/issues/03/06/ZipCompression/default.aspx
