在ASP中如何解压缩文件?

amyaming 2001-08-02 01:34:34
...全文
226 22 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
22 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinajordan 2001-08-03
  • 打赏
  • 举报
回复
chinajordan@sina.com 谢谢!!
TYmir 2001-08-03
  • 打赏
  • 举报
回复
tymir@china.com
lanying 2001-08-03
  • 打赏
  • 举报
回复
我的email:wzw888@263.net
neweb 2001-08-03
  • 打赏
  • 举报
回复
能给我一份吗?谢谢!
mg1616@hnbiz.com
lanying 2001-08-03
  • 打赏
  • 举报
回复
能把com的源代码给我吗?
多谢了
win1st 2001-08-03
  • 打赏
  • 举报
回复
看不明白,链你的思路我都没搞清楚
ttch007 2001-08-03
  • 打赏
  • 举报
回复
恩 呵呵
zuxian 2001-08-03
  • 打赏
  • 举报
回复
luoxh@371.et 和stanelystudio的已发
请查收
下面的稍等
(不过的我的组件还有不完善的地方,希望大家收到后提出改进意见)
ttt2 2001-08-03
  • 打赏
  • 举报
回复
给我一个可以吗?
ttt22703@sohu.com
woodkiller 2001-08-03
  • 打赏
  • 举报
回复
请给我一份,谢谢
qiaofuwu@263.net
zxwcq 2001-08-03
  • 打赏
  • 举报
回复
可以写COM来实现
zuxian 2001-08-03
  • 打赏
  • 举报
回复
以上我都把组件发过去了,因为组件还不完善,还有待改进。
组件是用java写的,我也是参考java版上一篇文章,
由于再解子目录时好想有问题,所以希望大家提出修改意见

import com.asp.dll.*;
import java.io.*;
import java.util.*;
import java.util.zip.*;

public class Class1
{public void unzip(String unzipfile)
{
try {
File olddirec = new File(unzipfile);//解压缩的文件路径(为了获取路径)
ZipInputStream zin = new ZipInputStream(
new FileInputStream(unzipfile));
ZipEntry entry;

//创建文件夹
while((entry = zin.getNextEntry()) != null)
if(entry.isDirectory())
{File directory = new File(olddirec.getParent(),entry.getName());
//System.out.println("Make directory " +directory.getParent()+"/"+entry.getName());
if(!directory.exists())
if(!directory.mkdirs())
System.exit(0);
zin.closeEntry();
}
zin.close();
//System.out.println("directory creat successful!");

zin = new ZipInputStream(new FileInputStream(unzipfile));

//解压缩文件
while(((entry = zin.getNextEntry()) != null)&&!entry.isDirectory())
{
FileOutputStream fout = new FileOutputStream(olddirec.getParent()+"/"+entry.getName());
DataOutputStream dout = new DataOutputStream(fout);

//System.out.println( "Writing file " + entry.getName());
byte [] b = new byte[1024];
int len = 0;
while ( (len=zin.read(b))!= -1 ) {
dout.write(b,0,len);
}
dout.close();
fout.close();
// System.out.println("End of Writing file " + entry.getName());
zin.closeEntry();
// System.out.println("Close entry successful!");
}
zin.close();

//System.out.println("Close File successful!");
}catch(IOException e)
{e.printStackTrace();
System.out.println(e);
}
}
}
winnn 2001-08-03
  • 打赏
  • 举报
回复
winnn@263.net
我也要一个
xunge 2001-08-03
  • 打赏
  • 举报
回复
me too:
snail_cn@21cn.com
asp9553 2001-08-03
  • 打赏
  • 举报
回复
还有我momo9553@sohu.com
Pasp 2001-08-03
  • 打赏
  • 举报
回复
还有我proton@yeah.net
lifanxi 2001-08-02
  • 打赏
  • 举报
回复
我也想要,能给我一个吗?谢谢
lifanxi@263.net
luoxxhh 2001-08-02
  • 打赏
  • 举报
回复
给我一个可以吗?
luoxh@371.net
谢谢谢谢!
zuxian 2001-08-02
  • 打赏
  • 举报
回复
稍等,现在组件不再这儿,晚上发给你
stanely 2001-08-02
  • 打赏
  • 举报
回复
thanks!
加载更多回复(2)

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧