我想在一打开某个ASP页面时,就让用户以文本格式下载页面内容,客户端是Win2k正确执行,是XP就不行,为什么???
<%
'=====================================
'代码:
'=====================================
' 导出到Txt文件
Sub ExportToTxt
dim resultfile
'得到要保存的文件名
resultfile = "Result.txt"
' 添加文件头信息
Response.ContentType = "txt/html"
Response.addheader "Content-Disposition","attechment;Filename=" & resultfile
' 输出内容
Response.Write "2008奥运吉祥物" & vbcrlf & vbcrlf
response.write "贝贝" & vbcrlf
response.write "晶晶" & vbcrlf
response.write "欢欢" & vbcrlf
response.write "迎迎" & vbcrlf
response.write "妮妮" & vbcrlf
End Sub
Call ExportToTxt
'=========================================================
'win2k下的执行结果(用户可以选择下载,也可以选择在线打开):
'=========================================================
2008奥运吉祥物
贝贝
晶晶
欢欢
迎迎
妮妮
'=========================================================
'XP下的执行结果(用户不可以选择下载,也不可以选择在线打开,网页直接显示在浏览器中):
'=========================================================
2008奥运吉祥物 贝贝晶晶欢欢迎迎妮妮
%>