Web form 里面如何only click a button ,就能一次过下载几个文件呢?
或者有什么其它方法能完成只做一个动作就能一次下载几个文件呢?
这个问题真系无聊,不过老板要求这样做,无办法.

解决方案 »

  1.   

    <script language=javascript>
    <!--
    function down()
    {
    window.open("a");
    window.open("b");
    window.open("c");
    }
    //-->
    </script>
    button调用改函数a,b,c为下载url
      

  2.   

    可以的,可以先得到要下载的文件的filename,然后foreach循环下载。
      

  3.   

    huleeyar(虚拟过客) 那个方法不行吧, 因为我那几个文件是Excel文件,如果用这方法就会在屏幕上直接显示出几个Excel的窗口,这样不行.我是想做到好象平常普通下载东西那样,一click完button就问save去那里,然后就保存在用户所选的地方. 以下是我做下载一个文件的代码,谁知道用那种方法可以做出下载几个文件的功能呢 :
    Response.ClearHeaders();
    Response.ClearContent();
     strDrive = "c:\\bb.xls";
     filename = "bb.xls";
    Response.Clear();
    Response.ContentType = "application/octet-stream";
    Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
    Response.AppendHeader("Content-Disposition","attachment; Filename = "  + System.Convert.ToChar(34) + filename + System.Convert.ToChar(34) );
    Response.Flush();
    Response.WriteFile( strDrive );
    Response.End();
    Response.Close();