求文件下载程序!

解决方案 »

  1.   

    Public Sub ClientSave(ByVal ServerPathFile As String)
            Response.Clear()
            Response.Buffer = False
            Response.Charset = "utf-8"
            Response.AppendHeader("Content-Disposition", "attachment;filename=Excel.xls")
            Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8")
            Response.ContentType = "application/ms-excel"
            Me.EnableViewState = False
            Response.WriteFile(ServerPathFile)
            'Response.End()
        End Sub