Ionic.ZIP 压缩时卡死 使用第三方Ionic.ZIP 进行分卷压缩时,对一个特殊的文件进行压缩时卡死。将这个文件授予everyone完全控制权限(源码测试好使,服务器还是不行),或者打开这个文件进行保存(不修改任何东西),再进行压缩则不会卡死。请问有大神遇到过类似情况么!求教!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没遇到过你说的这个问题,我常用的Ionic.ZIP 多文件压缩打包下载的方法:页面前台:<body><form id="form1" runat="server"><p><asp:Button ID="PackDown" runat="server" Text="打包下载" OnClick="PackDown_Click" /></p><asp:GridView ID="GridView1" runat="server" Width="500px" CellPadding="8" CellSpacing="1"> <Columns> <asp:TemplateField HeaderText="" InsertVisible="False"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> <ItemStyle HorizontalAlign="Center" /> </asp:TemplateField> <asp:TemplateField HeaderText="文件列表" InsertVisible="False"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns></asp:GridView></form></body>CS代码:void BindFilesList() { string strSql = "select Name from ClientDBInfo"; DataTable dt = m_db.ExecuteDataTable(strSql); GridView1.DataSource = dt; GridView1.DataBind(); } protected void PackDown_Click(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "application/zip"; Response.AddHeader("content-disposition", "filename=DotNetZip.zip"); using (ZipFile zip = new ZipFile(System.Text.Encoding.Default)) { foreach (GridViewRow gvr in GridView1.Rows) { if (((CheckBox)gvr.Cells[0].Controls[1]).Checked) { zip.AddFile(Server.MapPath("SoftwareDownload/") + (gvr.Cells[1].Controls[1] as Label).Text, ""); } } zip.Save(Response.OutputStream); } Response.End(); } 不好意思 昨天 突然有别的事 才看帖子。文件并不大,文件是从数据库抽取数据写入txt文件当中,每个txt不超过2m。 总体压缩文件大概2.8个g 压缩之后是700多m。有问题的是一个 1700多kb的一个txt文件。将这个文件从文件夹中拿出来 再压缩文件夹 就可以正常压缩,带着这个文件一起压缩就会卡死在大概270m的地方,如果将这个文件给予everyone权限在源码测试可以正常压缩,服务器上还是会卡死。将这个文件 打开 ctrl+s 一下,也可以正常压缩。这个文件自己单独压缩也没有问题。现象是如上所述的,现在我没发现 那个文件有什么问题,已经陷入蒙蔽中我想看看 有没有 人遇到跟我同样的情况 调用 zip.save 方法就会陷入无限卡死的状态,没有异常 没有 timeout 没有返回值 什么都没有 整个程序 卡死了 现在 还没法确定 是 第三方插件 ionic的问题 还是 txt文件 有问题 唉忧伤 很多数据怎么用Session传值 问一个xml的问题? asp.net 问题又来了! vs2005中使用母板的问题,急.... FCKeditor的问题 现在asp.net与php,jsp相比有什么优势啊? ChangePassword 控件的问题。另:带过项目的人能否到我公司兼职,带我们一个小项目。 global.asax问题 如何获取客户端显示器的分辨率? asp.net中窗口相关操作(如何使用javascript) 网站文章内的图片都不能显示了,求救!!! IIS 7环境下,viewstate获取不到正确的值。
<form id="form1" runat="server">
<p>
<asp:Button ID="PackDown" runat="server" Text="打包下载" OnClick="PackDown_Click" /></p>
<asp:GridView ID="GridView1" runat="server" Width="500px" CellPadding="8" CellSpacing="1">
<Columns>
<asp:TemplateField HeaderText="" InsertVisible="False">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="文件列表" InsertVisible="False">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</form>
</body>CS代码:
void BindFilesList()
{
string strSql = "select Name from ClientDBInfo";
DataTable dt = m_db.ExecuteDataTable(strSql);
GridView1.DataSource = dt;
GridView1.DataBind();
} protected void PackDown_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=DotNetZip.zip");
using (ZipFile zip = new ZipFile(System.Text.Encoding.Default))
{
foreach (GridViewRow gvr in GridView1.Rows)
{
if (((CheckBox)gvr.Cells[0].Controls[1]).Checked)
{
zip.AddFile(Server.MapPath("SoftwareDownload/") + (gvr.Cells[1].Controls[1] as Label).Text, "");
}
} zip.Save(Response.OutputStream);
} Response.End();
}