我按照以下方法
<%
Response.Buffer = true
Response.AddHeader "Content-Disposition","attachment; filename=文件名_"&TxtFileName&".csv"
Response.CharSet = "iso-8859-1" '文件编码
Response.ContentType = "application/octet-stream"
set sql ="select * from test"
set rs = conn.Execute(sql)
Response.Write rs.fields(0).name
for i=1 to rs.fields.count-1
Response.Write ";" & rs.fields(i).name
next
Response.Flush()
do while not rs.eof
Response.Write vbCrLf & rs(0)
for i=1 to rs.fields.count-1
Response.Write ";" & rs(i)
next
Response.Flush()
rs.Movenext
loop
rs.Close
conn.Close
set rs = nothing
set conn = nothing
Response.End()
%>
为什么也输出了html标签里的内容.列如: