同时多个文件下载的方法
有没有高手做过或知道的.能同时下载多个文件.
Public Sub DownloadFile(ByVal path As String, ByVal name As String)
Try
Dim file As New System.IO.FileInfo(path)
Response.Clear()
Response.Charset = "GB2312"
Response.ContentEncoding = System.Text.Encoding.UTF8
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(name))
Response.AddHeader("Content-Length", file.Length.ToString())
Response.ContentType = "application/ms-excel"
Response.WriteFile(file.FullName)
HttpContext.Current.ApplicationInstance.CompleteRequest()
Catch ex As Exception
Response.Write("<script>alert('11系统出现以下错误:\\n" + ex.ToString + "!\\n请尽快与管理员联系.')</script>")
End Try
调用
Try
Dim strPath As String = Server.MapPath("/") + FineName
DownloadFile(strPath, FineName)
Catch ex As Exception
Response.Write("<script>alert('22系统出现以下错误:\\n" + ex.ToString + "!\\n请尽快与管理员联系.')</script>")
End Try
我上面这个可以下载一个文件,会弹出一个文件保存框.
我想知道,怎么同时下载多个文件,就是不用一个文件点一次保存,取一次路径.