posts - 198,  comments - 1481,  trackbacks - 6
不知道博客园有多少朋友在使用AspSpider提供的免费空间,这里想给大家提个醒,AspSpider 将在2008年6月1日删除所有空间,需要备份的朋友请赶紧把自己的空间备份转移,以免造成不必要的损失。

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ICSharpCode.SharpZipLib.Zip;
using System.IO;

public partial class packfolder : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

        MemoryStream ms 
= new MemoryStream();
byte[] buffer;
string path = MapPath("");
string[] files = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
using (ZipOutputStream s = new ZipOutputStream(ms))
9); // 0-9, 9 being the highest compression
            foreach (string file in files)
                ZipEntry entry 
= new ZipEntry(file.Substring(path.Length+1));
= DateTime.Now;
0, buffer.Length);



= ms.ToArray();
= "application/zip";
"Content-disposition""attachment; filename= *.zip");
0, buffer.Length);


这段代码引用了 SharpZipLib

AspSpider Free Hosting Termination Notice

It is with deep regret that we inform you that starting May 1, 2008, will stop offering its free ASP.NET web hosting services. After May 1, 2008, your web sites will remain online for 30 days so that you have the opportunity to download your web site files and seek alternative hosting options. On June 1, 2008, all of our servers will be wiped clean and all web site files will be removed.

posted on 2008-05-19 18:07  RubyPDF  阅读(...)  评论(...编辑  收藏