Torna al Thread
Protected Sub lkbScarica_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbScarica.Click
If (DownloadFile()) Then
'salvo da qualche parte che ha finito...
End If
End Sub
Protected Function DownloadFile() As Boolean
Dim blOk As Boolean = True
Try
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=" + sNomeFileZip)
HttpContext.Current.Response.ContentType = "application/zip"
HttpContext.Current.Response.WriteFile(sNomeFileFullPathZip)
HttpContext.Current.Response.End()
Catch exTread As System.Threading.ThreadAbortException
blOk = True
Catch ex As Exception
blOk = False
End Try
Return blOk
End Function