asp.net 压缩解压缩zip文件(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-01 14:20 点击:次
{
try
{
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
ZipInputStream s = new ZipInputStream(File.OpenRead(file));
ZipEntry theEntry;
while ((theEntry = s.GetNextEntry()) != null)
{
string directoryName = Path.GetDirectoryName(theEntry.Name);
string fileName = Path.GetFileName(theEntry.Name);
if (directoryName != String.Empty)
{
Directory.CreateDirectory(dir + directoryName);
}
if (fileName != String.Empty)
{
FileStream streamWriter = File.Create(dir + theEntry.Name);
int size = 2048;
byte[] data = new byte[2048];
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>