兜兜转转有点晕:从服务器通过URL不中转保存的下载
从服务器通过URL不中转保存的下载
首先引用System.dll
然后新开一个页面,空的,在后台Page_Load方法里写
Dim docPath As String =””
Dim fileName As String =
Dim myWebClient As New Net.WebClient()
Dim data() As Byte = myWebClient.DownloadData(New Uri(docPath))
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileName))
Response.AddHeader("Content-Length", data.Length)
Response.ContentType = "application/octet-stream"
Response.BinaryWrite(data)
Response.End()
myWebClient.Dispose()
VB 老旧版本维护系列---兜兜转转有点晕:从服务器通过URL不中转保存的下载
,温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/40913.html
- 上一篇:more 查看网络队列
- 下一篇:Netty 中队列的使用