Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312")
Dim httpHeader As String = "attachment;filename=" + HttpUtility.UrlEncode("d:\cwreport\" & lblReportDate.Text & dpdnlstReportType.SelectedItem.Text & ".xls")
Dim file = New System.IO.FileInfo("d:\cwreport\" & dpdnlstReportType.SelectedItem.Text & ".xls")
Response.Clear()
Response.AddHeader("Content-Disposition", httpHeader)
Response.WriteFile(file.FullName)
Response.End()
这个可以解决txt的格式文件的下载需要。如果是简单一点:
Response.Redirect("11.txt")
超连接
<a href =11.txt>111111111</a>
posted on 2005-11-15 17:51
萌芽的叶子 阅读(182)
评论(0) 编辑 收藏 引用 所属分类:
html