SharpZipLib加密压缩的文件,用winrar的解压密码是什么?
string sFileName = Path.GetFileName(FileToZip);
if (!File.Exists(FileToZip))
{
throw new System.IO.FileNotFoundException("指定要压缩的文件: " + FileToZip + " 不存在!");
}
FileStream fs = File.OpenRead(FileToZip);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
FileStream ZipFile = File.Create(ZipedFile);
ZipOutputStream ZipStream = new ZipOutputStream(ZipFile);
ZipEntry ZipEntry = new ZipEntry(sFileName);
ZipEntry.DateTime = DateTime.Now;
string p = "a";
ZipStream.Password = p;
ZipStream.SetComment("密码为:" + ZipStream.Password);
ZipStream.SetLevel(6);
ZipStream.PutNextEntry(ZipEntry);
ZipStream.Write(buffer, 0, buffer.Length);
ZipStream.Finish();
ZipStream.Close();
能用SharpZipLib加密压缩文件,用SharpZipLib的代码也能解密解压。
我把密码写在备注中,用winrar打开后显示‘密码为:a’
但,问题是,我用winrar却无法解密解压该文件,输入密码‘a'却报密码错误。
那么,用winrar解压该文件时,该用什么密码呢?
...全文
相关推荐
ICSharpCode.SharpZipLib.dll.zip
在C#中使用ICSharpCode.SharpZipLib.dll文件做文件压缩、解压过成功,当添加压缩、解压密码以后,使用老版本的ICSharpCode.SharpZipLib.dll,在调用inputStream.GetNextEntry()时会提示wrong local header signature 错误。使用较新版本以后就能正常运行。从0.80.0.1373到0.86.0.518再到648.9.101.2版本均有。解压密码为:www.csdn.net
C#代码 压缩解压文件.doc
通过引用一DLL(ICSharpCode.dll)可以实现所述功能.... 一、压缩文件 二、解压文件
C#获取程序文件信息
C#获取程序文件信息
C#源码文件处理批量解压缩
C#源码文件处理批量解压缩
在线解压ASP系统 v1.0-ASP源码.zip
ASP源码,压缩包解压密码:www.cqlsoft.com


