最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Response.ContentType 控制输出文件类型(讨论下载文件问题)
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
<% Response.ContentType = "text/HTML" %>
<% Response.ContentType = "image/GIF" %>
<% Response.ContentType = "image/JPEG" %>
<% Response.ContentType = "text/plain" %>
<% Response.ContentType = "image/JPEG" %>
<% Response.ContentType = "application/x-cdf" %>
用于作为文本内容返回而不是已解释的 HTML 语句
Response.ContentType = "text/plain"
<%
Response.ContentType = "text/plain"
Response.write(now()&"会被执行么?")
%>
你可以注意到:页面提供下载,页面中的ASP内容被解释执行了的
程序文件以XLS文件被提供下载
Response.ContentType = "application/vnd.ms-excel"
<%
Response.ContentType = "application/vnd.ms-excel"
Response.write("本页面调试会出现下载对话框提供下载,保存类型为XLS")
%>
实现歌曲连续播放
response.ContentType="audio/x-pn-realaudio"
<%
dim ramstr
ramstr=""
set rs=server.createobject("adodb.recordset")
sql="XXXXXXXXXXX"
rs.open sql,conn,1,3 'conn已定义
do while not rs.eof
ramstr=ramstr&rs("url")&vbCrLf
rs.movenext
loop
rs.close
response.ContentType="audio/x-pn-realaudio"
'response.ContentType="audio/x-mpegurl"
-
下一个: 继承创建自定义的TreeView
相关文章
- python通过文件头判断文件类型的例子 08-18
- 免费1g/4g/支持各种文件类型/单个文件50m 10-29
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18