'//how to
Dim temp As Integer = InStr(url, "http://www.sina.com/soft")
If temp <> 0 Then
Dim path As String = Server.MapPath(Mid(url, temp + 33)) Dim result As String = Replace(path, "F:\aaa", "K:\bbb") Dim file As FileInfo = New FileInfo(result)
Response.Clear()
Response.AddHeader("content-disposition", "attachment; filename=" + file.Name) ' add the header that specifies the file size, so that the browser
' can show the download progress
Response.AddHeader("content-length", file.Length.ToString()) ' specify that the response is a stream that cannot be read by the
' client and must be downloade
Response.ContentType = "application/octet-stream" ' send the file stream to the client
Response.WriteFile(file.FullName) ' stop the execution of this page
Response.End() 'Label1.Text = result
End If
解决方案 »
- 如何取得循环条件中的数据
- 关于柱状图
- 采集新闻时,新闻内容有分页怎么办啊
- 长久以来积累的owc控件问题,查了n多资料没有详细资料,最少50分一题,谢谢出手帮助!
- 终极 Asp 中 DataGird 滚动问题 ,高手体验
- 水晶报表发布后的问题,不能显示?数据库
- 急
- 静态页面中动态的输出信息
- discuz!nt 3.6版本vs2010不能生成解决方案
- 请问各位大虾,如何将oracle的blob字段显示出来,我已经取到其值,但是显示出来的是乱码!
- 如何用javasript设置浏览器为每次都检测网页的最新版本?
- 我用VB。NET做了个DLL是打印ACTIVEREPORT的。用ASP。NET调用出现打印错误,请高手指点,急!谢谢
Response.AppendHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(sFileName,System.Text.Encoding.UTF8));
Response.WriteFile(filePath);
Response.End();
string filePath="路径"+"/"+sFileName;
string sFileName="text1.txt";